Filtrar e alterar o valor dos pandas
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1
Cerbrain
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1