All the code paths I could find force dtype:
Check pandas.Index.__new__()
if issubclass(data.dtype.type, np.integer): from .numeric import Int64Index return Int64Index(data, copy=copy, dtype=dtype, name=name)
This allows us to pass dtype, but in NumericIndex().__new__() we have:
if copy or not is_dtype_equal(data.dtype, cls._default_dtype): subarr = np.array(data, dtype=cls._default_dtype, copy=copy)
What changes dtype.
source share