We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2b1e10 commit b28670fCopy full SHA for b28670f
pandas/core/indexes/base.py
@@ -591,20 +591,20 @@ def _dtype_to_subclass(cls, dtype: DtypeObj):
591
592
return TimedeltaIndex
593
594
- elif is_float_dtype(dtype):
+ elif dtype.kind == "f":
595
from pandas.core.api import Float64Index
596
597
return Float64Index
598
- elif is_unsigned_integer_dtype(dtype):
+ elif dtype.kind == "u":
599
from pandas.core.api import UInt64Index
600
601
return UInt64Index
602
- elif is_signed_integer_dtype(dtype):
+ elif dtype.kind == "i":
603
from pandas.core.api import Int64Index
604
605
return Int64Index
606
607
- elif dtype == _dtype_obj:
+ elif dtype.kind == "O":
608
# NB: assuming away MultiIndex
609
return Index
610
0 commit comments