How to multiply certain values of a column by a constant?
You can use boolean indexing and isin
:
prod_list = [1069104, 1069105]
df.loc[df['product'].isin(prod_list), 'score'] *= 10
You can use boolean indexing and isin
:
prod_list = [1069104, 1069105]
df.loc[df['product'].isin(prod_list), 'score'] *= 10