-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Properly handle lists for .mask #21934
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 all commits
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 |
---|---|---|
|
@@ -7941,6 +7941,10 @@ def mask(self, cond, other=np.nan, inplace=False, axis=None, level=None, | |
inplace = validate_bool_kwarg(inplace, 'inplace') | ||
cond = com._apply_if_callable(cond, self) | ||
|
||
# see gh-21891 | ||
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.
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. Yes, it would. Because |
||
if not hasattr(cond, "__invert__"): | ||
cond = np.array(cond) | ||
|
||
return self.where(~cond, other=other, inplace=inplace, axis=axis, | ||
level=level, try_cast=try_cast, | ||
errors=errors) | ||
|
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.
I would do this in
.where
itselfThere 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.
Do what exactly in
.where
?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.
oh i c we are using
~
here, ok then.