1818 timedelta_range ,
1919)
2020import pandas ._testing as tm
21- from pandas .core .api import NumericIndex
2221from pandas .core .arrays import IntervalArray
2322import pandas .core .common as com
2423
@@ -39,9 +38,9 @@ class ConstructorTests:
3938 params = [
4039 ([3 , 14 , 15 , 92 , 653 ], np .int64 ),
4140 (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 ),
4544 (date_range ("20180101" , periods = 10 ), "<M8[ns]" ),
4645 (
4746 date_range ("20180101" , periods = 10 , tz = "US/Eastern" ),
@@ -69,10 +68,10 @@ def test_constructor(self, constructor, breaks_and_expected_subtype, closed, nam
6968 @pytest .mark .parametrize (
7069 "breaks, subtype" ,
7170 [
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" ),
7675 (date_range ("2017-01-01" , periods = 5 ), "int64" ),
7776 (timedelta_range ("1 day" , periods = 5 ), "int64" ),
7877 ],
@@ -91,9 +90,9 @@ def test_constructor_dtype(self, constructor, breaks, subtype):
9190 @pytest .mark .parametrize (
9291 "breaks" ,
9392 [
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 ),
9796 date_range ("2017-01-01" , periods = 5 ),
9897 timedelta_range ("1 day" , periods = 5 ),
9998 ],
@@ -250,8 +249,8 @@ def test_mixed_float_int(self, left_subtype, right_subtype):
250249 right = np .arange (1 , 10 , dtype = right_subtype )
251250 result = IntervalIndex .from_arrays (left , right )
252251
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 )
255254 expected_subtype = np .float64
256255
257256 tm .assert_index_equal (result .left , expected_left )
0 commit comments