open_in_new
content_copy
df['Purchase'] = df['Purchase'].apply(lambda x: 1 if x=='Yes' else 0)