Answers for "check if condition in pandas python"

6

or condition in pandas

df1 = df[(df.a != -1) & (df.b != -1)]
Posted by: Guest on June-03-2020
5

pandas if python

df['new column name'] = df['column name'].apply(lambda x: 'value if condition is met' if x condition else 'value if condition is not met')
Posted by: Guest on January-21-2021

Code answers related to "check if condition in pandas python"

Python Answers by Framework

Browse Popular Code Answers by Language