modify specific value in dataframe based on filter code example
Example 1: set value based on column
df.loc[df['c1'] == 'Value', 'c2'] = 10
Example 2: pandas filter and change value
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1
df.loc[df['c1'] == 'Value', 'c2'] = 10
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1