-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DEPR: Series.__getitem__, Series.__setitem__ #50617
Comments
There is probably a lot of code out there using Is having |
Another common non-ambiguous use case is Boolean masking. |
even boolean masking can manage to be ambiguous if you have bools in your index |
Another option would be to make getitem/setitem always label-based (after deprecation cycle), which would match the DataFrame behavior |
Would that also deprecate using Boolean masks? I'm +1 only allowing for label-based or Boolean masks, but hesitant if we aren't going to allow Boolean masks as well. |
no it would not. It would leave the ambiguous corner-case when you have a bool-dtype Index |
Trying to guess whether e.g.
ser[2]
,ser[:2]
is intended to be positional or label-based is a hassle, and in the slicing case we are inconsistent about it. Let's get rid of this problem once and for all by deprecating these and telling users to use loc or iloc instead.Discussed in #49612
The text was updated successfully, but these errors were encountered: