SyntaxFix
Write A Post
Hire A Developer
Questions
The answer from @lodagro is great. I would extend it by generalizing the mask function as:
def mask(df, f): return df[f(df)]
Then you can do stuff like:
df.mask(lambda x: x[0] < 0).mask(lambda x: x[1] > 0)