Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

if condition dataframe python

df.loc[df['age1'] - df['age2'] > 0, 'diff'] = df['age1'] - df['age2']
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #condition #dataframe #python
ADD COMMENT
Topic
Name
4+9 =