I need to multiply individual columns in a dataframe by weights. So I have the following code
df.C1 *= 0.2
df.C2 *= 0.01
Is there a better or short way of doing it, possibly a list of weights multiplied to columns?
Something like df.cols.values *= list(weights)
Something like
df1.loc[:,cols]=df1[cols].values*[100,10]