-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
API DesignIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves
Milestone
Description
Code Sample, a copy-pastable example if possible
Allow .where
and .mask
to accept callable
as cond. This is useful if DataFrame
is changed during method chaining.
df = pd.DataFrame(np.random.randn(2, 2))
df.where(lambda x: x > 0)
# currently raises ValueError
Expected Output
Should be the same as:
df.where(df > 0)
# 0 1
#0 0.689202 NaN
#1 NaN 0.261644
Metadata
Metadata
Assignees
Labels
API DesignIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselves