|
12 | 12 | from pandas import ( |
13 | 13 | CategoricalIndex, |
14 | 14 | DataFrame, |
15 | | - Float64Index, |
16 | | - Int64Index, |
| 15 | + Index, |
17 | 16 | IntervalIndex, |
18 | 17 | MultiIndex, |
19 | 18 | Series, |
20 | | - UInt64Index, |
21 | 19 | concat, |
22 | 20 | date_range, |
23 | 21 | option_context, |
|
30 | 28 | class NumericSeriesIndexing: |
31 | 29 |
|
32 | 30 | params = [ |
33 | | - (Int64Index, UInt64Index, Float64Index), |
| 31 | + (np.int64, np.uint64, np.float64), |
34 | 32 | ("unique_monotonic_inc", "nonunique_monotonic_inc"), |
35 | 33 | ] |
36 | | - param_names = ["index_dtype", "index_structure"] |
| 34 | + param_names = ["dtype", "index_structure"] |
37 | 35 |
|
38 | | - def setup(self, index, index_structure): |
| 36 | + def setup(self, dtype, index_structure): |
39 | 37 | N = 10**6 |
40 | 38 | indices = { |
41 | | - "unique_monotonic_inc": index(range(N)), |
42 | | - "nonunique_monotonic_inc": index( |
43 | | - list(range(55)) + [54] + list(range(55, N - 1)) |
| 39 | + "unique_monotonic_inc": Index(range(N), dtype=dtype), |
| 40 | + "nonunique_monotonic_inc": Index( |
| 41 | + list(range(55)) + [54] + list(range(55, N - 1)), dtype=dtype |
44 | 42 | ), |
45 | 43 | } |
46 | 44 | self.data = Series(np.random.rand(N), index=indices[index_structure]) |
@@ -159,17 +157,17 @@ def time_boolean_rows_boolean(self): |
159 | 157 | class DataFrameNumericIndexing: |
160 | 158 |
|
161 | 159 | params = [ |
162 | | - (Int64Index, UInt64Index, Float64Index), |
| 160 | + (np.int64, np.uint64, np.float64), |
163 | 161 | ("unique_monotonic_inc", "nonunique_monotonic_inc"), |
164 | 162 | ] |
165 | | - param_names = ["index_dtype", "index_structure"] |
| 163 | + param_names = ["dtype", "index_structure"] |
166 | 164 |
|
167 | | - def setup(self, index, index_structure): |
| 165 | + def setup(self, dtype, index_structure): |
168 | 166 | N = 10**5 |
169 | 167 | indices = { |
170 | | - "unique_monotonic_inc": index(range(N)), |
171 | | - "nonunique_monotonic_inc": index( |
172 | | - list(range(55)) + [54] + list(range(55, N - 1)) |
| 168 | + "unique_monotonic_inc": Index(range(N), dtype=dtype), |
| 169 | + "nonunique_monotonic_inc": Index( |
| 170 | + list(range(55)) + [54] + list(range(55, N - 1)), dtype=dtype |
173 | 171 | ), |
174 | 172 | } |
175 | 173 | self.idx_dupe = np.array(range(30)) * 99 |
@@ -201,7 +199,7 @@ class Take: |
201 | 199 | def setup(self, index): |
202 | 200 | N = 100000 |
203 | 201 | indexes = { |
204 | | - "int": Int64Index(np.arange(N)), |
| 202 | + "int": Index(np.arange(N), dtype=np.int64), |
205 | 203 | "datetime": date_range("2011-01-01", freq="S", periods=N), |
206 | 204 | } |
207 | 205 | index = indexes[index] |
|
0 commit comments