14
14
)
15
15
import pandas ._testing as tm
16
16
from pandas .core .arrays import TimedeltaArray
17
- from pandas .core .indexes .api import Int64Index
18
17
from pandas .tests .indexes .datetimelike import DatetimeLike
19
18
20
19
randn = np .random .randn
@@ -56,7 +55,7 @@ def test_map(self):
56
55
57
56
f = lambda x : x .days
58
57
result = rng .map (f )
59
- exp = Int64Index ([f (x ) for x in rng ])
58
+ exp = Index ([f (x ) for x in rng ], dtype = np . int32 )
60
59
tm .assert_index_equal (result , exp )
61
60
62
61
def test_pass_TimedeltaIndex_to_index (self ):
@@ -70,15 +69,16 @@ def test_pass_TimedeltaIndex_to_index(self):
70
69
71
70
def test_fields (self ):
72
71
rng = timedelta_range ("1 days, 10:11:12.100123456" , periods = 2 , freq = "s" )
73
- tm .assert_index_equal (rng .days , Index ([1 , 1 ], dtype = "int64" ))
72
+ tm .assert_index_equal (rng .days , Index ([1 , 1 ], dtype = np . int32 ))
74
73
tm .assert_index_equal (
75
74
rng .seconds ,
76
- Index ([10 * 3600 + 11 * 60 + 12 , 10 * 3600 + 11 * 60 + 13 ], dtype = "int64" ),
75
+ Index ([10 * 3600 + 11 * 60 + 12 , 10 * 3600 + 11 * 60 + 13 ], dtype = np . int32 ),
77
76
)
78
77
tm .assert_index_equal (
79
- rng .microseconds , Index ([100 * 1000 + 123 , 100 * 1000 + 123 ], dtype = "int64" )
78
+ rng .microseconds ,
79
+ Index ([100 * 1000 + 123 , 100 * 1000 + 123 ], dtype = np .int32 ),
80
80
)
81
- tm .assert_index_equal (rng .nanoseconds , Index ([456 , 456 ], dtype = "int64" ))
81
+ tm .assert_index_equal (rng .nanoseconds , Index ([456 , 456 ], dtype = np . int32 ))
82
82
83
83
msg = "'TimedeltaIndex' object has no attribute '{}'"
84
84
with pytest .raises (AttributeError , match = msg .format ("hours" )):
0 commit comments