26
26
timedelta_range ,
27
27
)
28
28
import pandas ._testing as tm
29
- from pandas .core .api import (
30
- Float64Index ,
31
- Int64Index ,
32
- UInt64Index ,
33
- )
29
+ from pandas .core .api import NumericIndex
34
30
from pandas .tests .arithmetic .common import (
35
31
assert_invalid_addsub_type ,
36
32
assert_invalid_comparison ,
@@ -492,10 +488,10 @@ def test_addition_ops(self):
492
488
# random indexes
493
489
msg = "Addition/subtraction of integers and integer-arrays"
494
490
with pytest .raises (TypeError , match = msg ):
495
- tdi + Int64Index ([1 , 2 , 3 ])
491
+ tdi + NumericIndex ([1 , 2 , 3 ], dtype = np . int64 )
496
492
497
493
# this is a union!
498
- # pytest.raises(TypeError, lambda : Int64Index ([1,2,3]) + tdi)
494
+ # pytest.raises(TypeError, lambda : Index ([1,2,3]) + tdi)
499
495
500
496
result = tdi + dti # name will be reset
501
497
expected = DatetimeIndex (["20130102" , NaT , "20130105" ])
@@ -1508,9 +1504,9 @@ def test_tdi_mul_float_series(self, box_with_array):
1508
1504
"other" ,
1509
1505
[
1510
1506
np .arange (1 , 11 ),
1511
- Int64Index ( range (1 , 11 )),
1512
- UInt64Index (range (1 , 11 )),
1513
- Float64Index (range (1 , 11 )),
1507
+ NumericIndex ( np . arange (1 , 11 ), np . int64 ),
1508
+ NumericIndex (range (1 , 11 ), np . uint64 ),
1509
+ NumericIndex (range (1 , 11 ), np . float64 ),
1514
1510
pd .RangeIndex (1 , 11 ),
1515
1511
],
1516
1512
ids = lambda x : type (x ).__name__ ,
@@ -1594,7 +1590,7 @@ def test_td64arr_div_tdlike_scalar(self, two_hours, box_with_array):
1594
1590
xbox = np .ndarray if box is pd .array else box
1595
1591
1596
1592
rng = timedelta_range ("1 days" , "10 days" , name = "foo" )
1597
- expected = Float64Index ((np .arange (10 ) + 1 ) * 12 , name = "foo" )
1593
+ expected = NumericIndex ((np .arange (10 ) + 1 ) * 12 , dtype = np . float64 , name = "foo" )
1598
1594
1599
1595
rng = tm .box_expected (rng , box )
1600
1596
expected = tm .box_expected (expected , xbox )
@@ -1634,7 +1630,7 @@ def test_td64arr_div_tdlike_scalar_with_nat(self, two_hours, box_with_array):
1634
1630
xbox = np .ndarray if box is pd .array else box
1635
1631
1636
1632
rng = TimedeltaIndex (["1 days" , NaT , "2 days" ], name = "foo" )
1637
- expected = Float64Index ([12 , np .nan , 24 ], name = "foo" )
1633
+ expected = NumericIndex ([12 , np .nan , 24 ], dtype = np . float64 , name = "foo" )
1638
1634
1639
1635
rng = tm .box_expected (rng , box )
1640
1636
expected = tm .box_expected (expected , xbox )
@@ -1652,7 +1648,7 @@ def test_td64arr_div_td64_ndarray(self, box_with_array):
1652
1648
xbox = np .ndarray if box is pd .array else box
1653
1649
1654
1650
rng = TimedeltaIndex (["1 days" , NaT , "2 days" ])
1655
- expected = Float64Index ([12 , np .nan , 24 ])
1651
+ expected = NumericIndex ([12 , np .nan , 24 ], dtype = np . float64 )
1656
1652
1657
1653
rng = tm .box_expected (rng , box )
1658
1654
expected = tm .box_expected (expected , xbox )
0 commit comments