I have a dataframe with hundreds of rows. I want to fill the NaN starting from T1 column, by multiplying the value in the same row in weight column with the value in the first row within the same T column (sorry if my wording is hard to understand). Below is a sample of the original dataframe:
ID weight T1 T2 T3 T4
0 A 1.00 1000 2000 3000 4000
1 B 0.04 NaN NaN NaN NaN
2 C 0.01 NaN NaN NaN NaN
3 D 0.06 NaN NaN NaN NaN
An example of the multiplication I want:
ID weight T1 T2
0 A 1.00 1000 2000
1 B 0.03 0.03*1000 0.03*2000
2 C 0.02 0.02*1000 0.02*2000
3 D 0.07 0.07*1000 0.07*2000
How can this be done?