-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: KeyError when a series popped from data frame with bool indexer #42644
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
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.
Small comments, please add whatsnew
pandas/core/series.py
Outdated
@@ -1234,7 +1234,7 @@ def _maybe_update_cacher( | |||
if ref is None: | |||
del self._cacher | |||
else: | |||
if len(self) == len(ref): | |||
if len(self) == len(ref) and self.name in ref.columns: # GH#42530 |
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.
don't put the comment after the line, makes this very hard to read. you can add in the if block with an explanation.
would be ok making this an if/elif/else block
thanks @debnathshoham |
@meeseeksdev backport 1.3.x |
This comment has been minimized.
This comment has been minimized.
@simonjayhawkins you are right, the release note is in the wrong place. |
just doing the backport now with the release note in 1.3.2. and then a separate PR to move the release note (which won't need a backport, unless we get conflicts in the meantime and I need to resync) |
… data frame with bool indexer
…e with bool indexer (#42728) Co-authored-by: Shoham Debnath <[email protected]>
DOC: move release note PR pandas-dev#42644 (pandas-dev#42730)
KeyError
when assigning to Series values after pop from DataFrame #42530