DEPR: Int64Index, UInt64Index & Float64Index by topper-123 · Pull Request #43028 · pandas-dev/pandas (original) (raw)

I've made a new version where accessing Int64Index etc. in the main namespace emits a FutureWarning. So these give warnings now:

import pandas as pd idx = pd.Int64Index([8, 9]) FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.NumericIndex with the appropriate dtype instead. isinstance(idx, pd.Int64Index) FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.NumericIndex with the appropriate dtype instead. True

but this does not:

idx = pd.Index([8, 9]) idx Int64Index([8, 9], dtype='int64') isinstance(idx, pd.NumericIndex) True

This last example doesn’t give warnings, because this access pattern is not deprecated, but will only change meaning in Pandas 2.0 (will return a NumericIndex rather than a Int64Index, + Int64Index is a subclass of NumericIndex).

These warnings should IMO give users a good hint on where they need to update their code to stay compatible in Pandas 2.0.