@@ -317,7 +317,6 @@ class Index(IndexOpsMixin, PandasObject):
317317 DatetimeIndex : Index of datetime64 data.
318318 TimedeltaIndex : Index of timedelta64 data.
319319 PeriodIndex : Index of Period data.
320- NumericIndex : Index of numpy int/uint/float data.
321320
322321 Notes
323322 -----
@@ -539,7 +538,6 @@ def __new__(
539538
540539 klass = cls ._dtype_to_subclass (arr .dtype )
541540
542- # _ensure_array _may_ be unnecessary once NumericIndex etc are gone
543541 arr = klass ._ensure_array (arr , arr .dtype , copy = False )
544542 return klass ._simple_new (arr , name )
545543
@@ -596,18 +594,11 @@ def _dtype_to_subclass(cls, dtype: DtypeObj):
596594
597595 return TimedeltaIndex
598596
599- elif dtype .kind in ["i" , "f" , "u" ]:
600- from pandas .core .api import NumericIndex
601-
602- return NumericIndex
603-
604597 elif dtype .kind == "O" :
605598 # NB: assuming away MultiIndex
606599 return Index
607600
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 ):
611602 return Index
612603
613604 raise NotImplementedError (dtype )
@@ -1207,10 +1198,6 @@ def __repr__(self) -> str_t:
12071198 Return a string representation for this object.
12081199 """
12091200 klass_name = type (self ).__name__
1210- from pandas .core .indexes .numeric import NumericIndex
1211-
1212- if type (self ) is NumericIndex :
1213- klass_name = "Index"
12141201 data = self ._format_data ()
12151202 attrs = self ._format_attrs ()
12161203 space = self ._format_space ()
@@ -5375,6 +5362,7 @@ def identical(self, other) -> bool:
53755362 for c in self ._comparables
53765363 )
53775364 and type (self ) == type (other )
5365+ and self .dtype == other .dtype
53785366 )
53795367
53805368 @final
0 commit comments