18
18
timedelta_range ,
19
19
)
20
20
import pandas ._testing as tm
21
- from pandas .core .api import NumericIndex
22
21
from pandas .core .arrays import IntervalArray
23
22
import pandas .core .common as com
24
23
@@ -39,9 +38,9 @@ class ConstructorTests:
39
38
params = [
40
39
([3 , 14 , 15 , 92 , 653 ], np .int64 ),
41
40
(np .arange (10 , dtype = "int64" ), np .int64 ),
42
- (NumericIndex (np .arange (- 10 , 11 , dtype = np .int64 )), np .int64 ),
43
- (NumericIndex (np .arange (10 , 31 , dtype = np .uint64 )), np .uint64 ),
44
- (NumericIndex (np .arange (20 , 30 , 0.5 ), dtype = np .float64 ), np .float64 ),
41
+ (Index (np .arange (- 10 , 11 , dtype = np .int64 )), np .int64 ),
42
+ (Index (np .arange (10 , 31 , dtype = np .uint64 )), np .uint64 ),
43
+ (Index (np .arange (20 , 30 , 0.5 ), dtype = np .float64 ), np .float64 ),
45
44
(date_range ("20180101" , periods = 10 ), "<M8[ns]" ),
46
45
(
47
46
date_range ("20180101" , periods = 10 , tz = "US/Eastern" ),
@@ -69,10 +68,10 @@ def test_constructor(self, constructor, breaks_and_expected_subtype, closed, nam
69
68
@pytest .mark .parametrize (
70
69
"breaks, subtype" ,
71
70
[
72
- (NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "float64" ),
73
- (NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "datetime64[ns]" ),
74
- (NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "timedelta64[ns]" ),
75
- (NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .float64 ), "int64" ),
71
+ (Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "float64" ),
72
+ (Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "datetime64[ns]" ),
73
+ (Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ), "timedelta64[ns]" ),
74
+ (Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .float64 ), "int64" ),
76
75
(date_range ("2017-01-01" , periods = 5 ), "int64" ),
77
76
(timedelta_range ("1 day" , periods = 5 ), "int64" ),
78
77
],
@@ -91,9 +90,9 @@ def test_constructor_dtype(self, constructor, breaks, subtype):
91
90
@pytest .mark .parametrize (
92
91
"breaks" ,
93
92
[
94
- NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ),
95
- NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .uint64 ),
96
- NumericIndex ([0 , 1 , 2 , 3 , 4 ], dtype = np .float64 ),
93
+ Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .int64 ),
94
+ Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .uint64 ),
95
+ Index ([0 , 1 , 2 , 3 , 4 ], dtype = np .float64 ),
97
96
date_range ("2017-01-01" , periods = 5 ),
98
97
timedelta_range ("1 day" , periods = 5 ),
99
98
],
@@ -250,8 +249,8 @@ def test_mixed_float_int(self, left_subtype, right_subtype):
250
249
right = np .arange (1 , 10 , dtype = right_subtype )
251
250
result = IntervalIndex .from_arrays (left , right )
252
251
253
- expected_left = NumericIndex (left , dtype = np .float64 )
254
- expected_right = NumericIndex (right , dtype = np .float64 )
252
+ expected_left = Index (left , dtype = np .float64 )
253
+ expected_right = Index (right , dtype = np .float64 )
255
254
expected_subtype = np .float64
256
255
257
256
tm .assert_index_equal (result .left , expected_left )
0 commit comments