filter panda dan ubah nilai

df.loc[df['dollars_spent'] > 0, 'purchase'] = 1
Cerbrain