@@ -377,7 +377,7 @@ def test_divmod_zero(self, zero, numeric_idx):
377
377
@pytest .mark .parametrize ("op" , [operator .truediv , operator .floordiv ])
378
378
def test_div_negative_zero (self , zero , numeric_idx , op ):
379
379
# Check that -1 / -0.0 returns np.inf, not -np.inf
380
- if isinstance ( numeric_idx , UInt64Index ) :
380
+ if numeric_idx . dtype == np . uint64 :
381
381
return
382
382
idx = numeric_idx - 3
383
383
@@ -669,15 +669,15 @@ def test_mul_int_array(self, numeric_idx):
669
669
result = idx * np .array (5 , dtype = "int64" )
670
670
tm .assert_index_equal (result , idx * 5 )
671
671
672
- arr_dtype = "uint64" if isinstance ( idx , UInt64Index ) else "int64"
672
+ arr_dtype = "uint64" if idx . dtype == np . uint64 else "int64"
673
673
result = idx * np .arange (5 , dtype = arr_dtype )
674
674
tm .assert_index_equal (result , didx )
675
675
676
676
def test_mul_int_series (self , numeric_idx ):
677
677
idx = numeric_idx
678
678
didx = idx * idx
679
679
680
- arr_dtype = "uint64" if isinstance ( idx , UInt64Index ) else "int64"
680
+ arr_dtype = "uint64" if idx . dtype == np . uint64 else "int64"
681
681
result = idx * Series (np .arange (5 , dtype = arr_dtype ))
682
682
tm .assert_series_equal (result , Series (didx ))
683
683
@@ -714,7 +714,7 @@ def test_pow_float(self, op, numeric_idx, box_with_array):
714
714
# test power calculations both ways, GH#14973
715
715
box = box_with_array
716
716
idx = numeric_idx
717
- expected = Float64Index (op (idx .values , 2.0 ))
717
+ expected = Index (op (idx .values , 2.0 ))
718
718
719
719
idx = tm .box_expected (idx , box )
720
720
expected = tm .box_expected (expected , box )
@@ -1216,7 +1216,7 @@ def test_binops_index(self, op, idx1, idx2):
1216
1216
idx1 = idx1 ._rename ("foo" )
1217
1217
idx2 = idx2 ._rename ("bar" )
1218
1218
result = op (idx1 , idx2 )
1219
- expected = op (Int64Index (idx1 ), Int64Index (idx2 ))
1219
+ expected = op (Index (idx1 . to_numpy ()), Index (idx2 . to_numpy () ))
1220
1220
tm .assert_index_equal (result , expected , exact = "equiv" )
1221
1221
1222
1222
@pytest .mark .parametrize (
@@ -1252,7 +1252,7 @@ def test_binops_index_pow(self, idx1, idx2):
1252
1252
idx1 = idx1 ._rename ("foo" )
1253
1253
idx2 = idx2 ._rename ("bar" )
1254
1254
result = pow (idx1 , idx2 )
1255
- expected = pow (Int64Index (idx1 ), Int64Index (idx2 ))
1255
+ expected = pow (Index (idx1 . to_numpy ()), Index (idx2 . to_numpy () ))
1256
1256
tm .assert_index_equal (result , expected , exact = "equiv" )
1257
1257
1258
1258
@pytest .mark .parametrize ("idx" , [RangeIndex (0 , 10 , 1 ), RangeIndex (0 , 20 , 2 )])
@@ -1330,7 +1330,7 @@ def test_numeric_compat2(self):
1330
1330
# __pow__
1331
1331
idx = RangeIndex (0 , 1000 , 2 )
1332
1332
result = idx ** 2
1333
- expected = Int64Index (idx ._values ) ** 2
1333
+ expected = Index (idx ._values ) ** 2
1334
1334
tm .assert_index_equal (Index (result .values ), expected , exact = True )
1335
1335
1336
1336
@pytest .mark .parametrize (
0 commit comments