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
34
from pandas .tests .arithmetic .common import (
30
35
assert_invalid_addsub_type ,
31
36
assert_invalid_comparison ,
@@ -489,10 +494,10 @@ def test_addition_ops(self):
489
494
# random indexes
490
495
msg = "Addition/subtraction of integers and integer-arrays"
491
496
with pytest .raises (TypeError , match = msg ):
492
- tdi + pd . Int64Index ([1 , 2 , 3 ])
497
+ tdi + Int64Index ([1 , 2 , 3 ])
493
498
494
499
# this is a union!
495
- # pytest.raises(TypeError, lambda : pd. Int64Index([1,2,3]) + tdi)
500
+ # pytest.raises(TypeError, lambda : Int64Index([1,2,3]) + tdi)
496
501
497
502
result = tdi + dti # name will be reset
498
503
expected = DatetimeIndex (["20130102" , NaT , "20130105" ])
@@ -1570,9 +1575,9 @@ def test_tdi_mul_float_series(self, box_with_array):
1570
1575
"other" ,
1571
1576
[
1572
1577
np .arange (1 , 11 ),
1573
- pd . Int64Index (range (1 , 11 )),
1574
- pd . UInt64Index (range (1 , 11 )),
1575
- pd . Float64Index (range (1 , 11 )),
1578
+ Int64Index (range (1 , 11 )),
1579
+ UInt64Index (range (1 , 11 )),
1580
+ Float64Index (range (1 , 11 )),
1576
1581
pd .RangeIndex (1 , 11 ),
1577
1582
],
1578
1583
ids = lambda x : type (x ).__name__ ,
@@ -1642,7 +1647,7 @@ def test_td64arr_div_tdlike_scalar(self, two_hours, box_with_array):
1642
1647
xbox = np .ndarray if box is pd .array else box
1643
1648
1644
1649
rng = timedelta_range ("1 days" , "10 days" , name = "foo" )
1645
- expected = pd . Float64Index ((np .arange (10 ) + 1 ) * 12 , name = "foo" )
1650
+ expected = Float64Index ((np .arange (10 ) + 1 ) * 12 , name = "foo" )
1646
1651
1647
1652
rng = tm .box_expected (rng , box )
1648
1653
expected = tm .box_expected (expected , xbox )
@@ -1685,7 +1690,7 @@ def test_td64arr_div_tdlike_scalar_with_nat(self, two_hours, box_with_array):
1685
1690
xbox = np .ndarray if box is pd .array else box
1686
1691
1687
1692
rng = TimedeltaIndex (["1 days" , NaT , "2 days" ], name = "foo" )
1688
- expected = pd . Float64Index ([12 , np .nan , 24 ], name = "foo" )
1693
+ expected = Float64Index ([12 , np .nan , 24 ], name = "foo" )
1689
1694
1690
1695
rng = tm .box_expected (rng , box )
1691
1696
expected = tm .box_expected (expected , xbox )
@@ -1703,7 +1708,7 @@ def test_td64arr_div_td64_ndarray(self, box_with_array):
1703
1708
xbox = np .ndarray if box is pd .array else box
1704
1709
1705
1710
rng = TimedeltaIndex (["1 days" , NaT , "2 days" ])
1706
- expected = pd . Float64Index ([12 , np .nan , 24 ])
1711
+ expected = Float64Index ([12 , np .nan , 24 ])
1707
1712
1708
1713
rng = tm .box_expected (rng , box )
1709
1714
expected = tm .box_expected (expected , xbox )
@@ -1846,7 +1851,7 @@ def test_td64arr_floordiv_tdlike_scalar(self, two_hours, box_with_array):
1846
1851
xbox = np .ndarray if box is pd .array else box
1847
1852
1848
1853
tdi = timedelta_range ("1 days" , "10 days" , name = "foo" )
1849
- expected = pd . Int64Index ((np .arange (10 ) + 1 ) * 12 , name = "foo" )
1854
+ expected = Int64Index ((np .arange (10 ) + 1 ) * 12 , name = "foo" )
1850
1855
1851
1856
tdi = tm .box_expected (tdi , box )
1852
1857
expected = tm .box_expected (expected , xbox )
0 commit comments