DEPR: deprecate Index.__getitem__ with float key #34191
Labels
API - Consistency
Internal Consistency of API/Behavior
Deprecate
Functionality to remove in pandas
Indexing
Related to indexing on series/frames, not to indexes themselves
Milestone
I would propose to deprecate interpreting float numbers as integers in Index
__getitem__
.Numpy does (no longer) allow this:
With a Series with
iloc
, we also don't allow this:But for Index we do check if the float is integer-like and in that case convert to integer:
However, this is not for all Index subclasses the case, eg:
So I think we can simply deprecate this to align Index with numpy/Series/some Index subclasses.
The text was updated successfully, but these errors were encountered: