Filtro de pandas y valor de cambio
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1
Cerbrain
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1