-
-
Notifications
You must be signed in to change notification settings - Fork 18k
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: positional indexing on Series __getitem__/__setitem__ #53201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
if index is d0: | ||
warn = FutureWarning | ||
with tm.assert_produces_warning(warn, match=msg): | ||
assert s.get(10, "z") == "z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this case raise a FutureWarning
? I would expect Series.get
to always act like label based indexing with fallback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NDFrame.get is a try/except around __getitem__
. xref #17928
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's annoying. Okay makes sense here
Thanks @jbrockmendel |
…ev#53201) * DEPR: positional indexing on Series __getitem__/__setitem__ * troubleshoot docs * troubleshoot docs * update doc * update docs * docs * update fixture * update doctest
…ev#53201) * DEPR: positional indexing on Series __getitem__/__setitem__ * troubleshoot docs * troubleshoot docs * update doc * update docs * docs * update fixture * update doctest
…em__ (#14654) This PR deprecates positional access in `Series.__getitem__` when a label-based index is present. xref: pandas-dev/pandas#53201 On `pandas_2.0_feature_branch`: ``` = 260 failed, 101179 passed, 2091 skipped, 954 xfailed, 312 xpassed in 1104.58s (0:18:24) = ``` This PR: ``` = 248 failed, 101190 passed, 2091 skipped, 954 xfailed, 312 xpassed in 1105.78s (0:18:25) = ```
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.xref #50617, possibly closes