SyntaxFix
Write A Post
Hire A Developer
Questions
I would use lambda function on a Series of a DataFrame like this:
lambda
Series
DataFrame
f = lambda x: 0 if x>100 else 1 df['my_column'] = df['my_column'].map(f)
I do not assert that this is an efficient way, but it works fine.