-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix regression for setitem not aligning rhs with boolean indexer #39944
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
Changes from 4 commits
cbea568
94a0258
3b05b3b
347b14d
0071348
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3264,6 +3264,9 @@ def _setitem_array(self, key, value): | |
key = check_bool_indexer(self.index, key) | ||
indexer = key.nonzero()[0] | ||
self._check_setitem_copy() | ||
if isinstance(value, DataFrame): | ||
# GHä39931 reindex since iloc does not align | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. otherwise LGTM. Thanks @phofl There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thx |
||
value = value.reindex(self.index.take(indexer)) | ||
self.iloc[indexer] = value | ||
else: | ||
if isinstance(value, DataFrame): | ||
|
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.
does series hit this path?
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.
No, I did this because value could be an array for example
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.
ok great