(self, op, shape)
| 131 | param_names = ["op", "shape"] |
| 132 | |
| 133 | def setup(self, op, shape): |
| 134 | # we choose dtypes so as to make the blocks |
| 135 | # a) not perfectly match between right and left |
| 136 | # b) appreciably bigger than single columns |
| 137 | n_rows, n_cols = shape |
| 138 | |
| 139 | if op is operator.floordiv: |
| 140 | # floordiv is much slower than the other operations -> use less data |
| 141 | n_rows = n_rows // 10 |
| 142 | |
| 143 | # construct dataframe with 2 blocks |
| 144 | arr1 = np.random.randn(n_rows, n_cols // 2).astype("f8") |
| 145 | arr2 = np.random.randn(n_rows, n_cols // 2).astype("f4") |
| 146 | df = pd.concat([DataFrame(arr1), DataFrame(arr2)], axis=1, ignore_index=True) |
| 147 | # should already be the case, but just to be sure |
| 148 | df._consolidate_inplace() |
| 149 | |
| 150 | # TODO: GH#33198 the setting here shouldn't need two steps |
| 151 | arr1 = np.random.randn(n_rows, max(n_cols // 4, 3)).astype("f8") |
| 152 | arr2 = np.random.randn(n_rows, n_cols // 2).astype("i8") |
| 153 | arr3 = np.random.randn(n_rows, n_cols // 4).astype("f8") |
| 154 | df2 = pd.concat( |
| 155 | [DataFrame(arr1), DataFrame(arr2), DataFrame(arr3)], |
| 156 | axis=1, |
| 157 | ignore_index=True, |
| 158 | ) |
| 159 | # should already be the case, but just to be sure |
| 160 | df2._consolidate_inplace() |
| 161 | |
| 162 | self.left = df |
| 163 | self.right = df2 |
| 164 | |
| 165 | def time_op_different_blocks(self, op, shape): |
| 166 | # blocks (and dtypes) are not aligned |
nothing calls this directly
no test coverage detected