We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Allow .where and .mask to accept callable as cond. This is useful if DataFrame is changed during method chaining.
.where
.mask
callable
DataFrame
df = pd.DataFrame(np.random.randn(2, 2)) df.where(lambda x: x > 0) # currently raises ValueError
Should be the same as:
df.where(df > 0) # 0 1 #0 0.689202 NaN #1 NaN 0.261644
The text was updated successfully, but these errors were encountered:
yeah I link to the master issue for this #11485; .query, .where, and indexers should accept callables
.query
Sorry, something went wrong.
7bbd031
Successfully merging a pull request may close this issue.
Code Sample, a copy-pastable example if possible
Allow
.where
and.mask
to acceptcallable
as cond. This is useful ifDataFrame
is changed during method chaining.Expected Output
Should be the same as:
The text was updated successfully, but these errors were encountered: