-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
REGR: Series access with Index of tuples/frozenset #36147
Conversation
pandas/core/series.py
Outdated
result = self._get_value(key) | ||
|
||
return result | ||
if isinstance(self.index, MultiIndex): |
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.
instead of doing the if first, can you do it in the keyerror itself e.g.
try:
result = self._get_value(key)
return result
except KeyError:
if isinstance(self.index, MultiIndex):
return self._get_values_tuple(key)
of course maybe we should actually do this inside _get_value
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.
Since _get_value
is called from 4 places, I'll look into doing this for 1.2 in a followup.
Thanks @jreback, I reworked the logic. This patch now retains much more of the original behavior. When one tries to find a tuple key in a Series with an Index, originally you got the message |
@simonjayhawkins this is ok to merge on green if you haven't tagged (otherwise can move to 1.1.3) |
yep |
restarting ci. known failure
|
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.
same test failed. may need further investigation
ok let's defer this one |
LGTM whatsnew-placement notwithstanding |
Failure is different this time.
|
I think this one is affecting all PRs |
@jreback Same unrelated parquet failure; the groupby plots failure no longer occurs. |
Thanks for the review @jbrockmendel, changes made and checks pass. |
thanks @rhshadrach for the followon's can open an issue if you want so we can track. |
@meeseeksdev backport 1.1.x |
#36332) Co-authored-by: Richard Shadrach <[email protected]>
frozenset
elements from a pd.Series or pd.DataFrame #35747black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff