filter and replace values pandas code example
Example 1: replacing values in pandas dataframe
df['coloum'] = df['coloum'].replace(['value_1','valu_2'],'new_value')
Example 2: pandas filter and change value
df.loc[df['dollars_spent'] > 0, 'purchase'] = 1