Imagine we have dataframe and let's try to filter it like:
df[df[0] == 'Test_value'].iloc[:, 1:5]
So that we have filtered by values Test_value
in a column 0
, and we take only 1 to 5 columns. Now I want to change these values from dataframe. I want to multiply them by a list like [1,3,1,2].
At the end, I want my initial dataframe with changes only in those specific cells.
ps: df.mul()
func doing well but it's only return me changed cells (df[df[0] == 'Test_value].iloc[:, 1:5])
, but I cannot set them to my initial dataframe: df[df[0] == 'Test_value].iloc[:, 1:5] = df[df[0] == 'Test_value].iloc[:, 1:5].mul(list)
not working ((