(self, pd_type, dtype)
| 37 | dtype_mapping = {"str": "str", "string[python]": object, "string[pyarrow]": object} |
| 38 | |
| 39 | def setup(self, pd_type, dtype): |
| 40 | series_arr = np.array( |
| 41 | [str(i) * 10 for i in range(100_000)], dtype=self.dtype_mapping[dtype] |
| 42 | ) |
| 43 | if pd_type == "series": |
| 44 | self.arr = series_arr |
| 45 | elif pd_type == "frame": |
| 46 | self.arr = series_arr.reshape((50_000, 2)).copy() |
| 47 | elif pd_type == "categorical_series": |
| 48 | # GH37371. Testing construction of string series/frames from ExtensionArrays |
| 49 | self.arr = Categorical(series_arr) |
| 50 | |
| 51 | def time_construction(self, pd_type, dtype): |
| 52 | self.pd_mapping[pd_type](self.arr, dtype=dtype) |
nothing calls this directly
no test coverage detected