@@ -317,7 +317,6 @@ class Index(IndexOpsMixin, PandasObject):
317
317
DatetimeIndex : Index of datetime64 data.
318
318
TimedeltaIndex : Index of timedelta64 data.
319
319
PeriodIndex : Index of Period data.
320
- NumericIndex : Index of numpy int/uint/float data.
321
320
322
321
Notes
323
322
-----
@@ -539,7 +538,6 @@ def __new__(
539
538
540
539
klass = cls ._dtype_to_subclass (arr .dtype )
541
540
542
- # _ensure_array _may_ be unnecessary once NumericIndex etc are gone
543
541
arr = klass ._ensure_array (arr , arr .dtype , copy = False )
544
542
return klass ._simple_new (arr , name )
545
543
@@ -596,18 +594,11 @@ def _dtype_to_subclass(cls, dtype: DtypeObj):
596
594
597
595
return TimedeltaIndex
598
596
599
- elif dtype .kind in ["i" , "f" , "u" ]:
600
- from pandas .core .api import NumericIndex
601
-
602
- return NumericIndex
603
-
604
597
elif dtype .kind == "O" :
605
598
# NB: assuming away MultiIndex
606
599
return Index
607
600
608
- elif issubclass (
609
- dtype .type , (str , bool , np .bool_ , complex , np .complex64 , np .complex128 )
610
- ):
601
+ elif issubclass (dtype .type , str ) or is_numeric_dtype (dtype ):
611
602
return Index
612
603
613
604
raise NotImplementedError (dtype )
@@ -1207,10 +1198,6 @@ def __repr__(self) -> str_t:
1207
1198
Return a string representation for this object.
1208
1199
"""
1209
1200
klass_name = type (self ).__name__
1210
- from pandas .core .indexes .numeric import NumericIndex
1211
-
1212
- if type (self ) is NumericIndex :
1213
- klass_name = "Index"
1214
1201
data = self ._format_data ()
1215
1202
attrs = self ._format_attrs ()
1216
1203
space = self ._format_space ()
@@ -5375,6 +5362,7 @@ def identical(self, other) -> bool:
5375
5362
for c in self ._comparables
5376
5363
)
5377
5364
and type (self ) == type (other )
5365
+ and self .dtype == other .dtype
5378
5366
)
5379
5367
5380
5368
@final
0 commit comments