| 177 | |
| 178 | |
| 179 | class Take: |
| 180 | params = ([np.array([0]), np.arange(100_000), np.full(100_000, -1)], [True, False]) |
| 181 | param_names = ["indices", "allow_fill"] |
| 182 | |
| 183 | def setup(self, indices, allow_fill): |
| 184 | N = 1_000_000 |
| 185 | fill_value = 0.0 |
| 186 | arr = make_array(N, 1e-5, fill_value, np.float64) |
| 187 | self.sp_arr = SparseArray(arr, fill_value=fill_value) |
| 188 | |
| 189 | def time_take(self, indices, allow_fill): |
| 190 | self.sp_arr.take(indices, allow_fill=allow_fill) |
| 191 | |
| 192 | |
| 193 | class GetItem: |