API: Deprecate Index.is_(boolean|categorical|integer|floating|numeric|object|interval) · Issue #50042 · pandas-dev/pandas (original) (raw)
Feature Type
- Adding new functionality to pandas
- Changing existing functionality in pandas
- Removing existing functionality in pandas
Problem Description
I propose deprecating the mentioned methods on Index
.
I suggest dtype checking should be the same for indexes, series and arrays, so e.g. if users want to check the dtype of an index they should use the functions in pandas.api.types
, e.g. for numeric dtype checks, do pd.api.types.is_numeric_dtype(idx)
.
Feature Description
Deprecate the mentioned methods and make users use the functions they'd use for series, i.e. the dtype checking functions in pandas.api.types
.
Alternative Solutions
The alternative is not deprecating the methods...
Methods to deprecate:
- is_boolean (PR: DEPR: deprecate Index.is_boolean #50176)
- is_integer (PR: DEPR: deprecate Index.is_integer #50178)
- is_floating (PR: DEPR: deprecate Index.is_floating #50235)
- is_numeric (PR: DEPR: deprecate Index.is_numeric #50769)
- is_object (PR: DEPR: deprecate Index.is_object #50227)
- is_categorical (PR: DEPR: deprecate Index.is_categorical #50225)
- is_interval (PR: DEPR: deprecate Index.is_interval #50196)