I wish to SUM the first two column values that have numbers where row == 'BB' and place in new row below
Data
ID Q121 Q221 Q321 Q421
AA 8.0 4.8 3.1 5.3
BB 0.6 0.7 0.3 0.9
Desired
ID Q121 Q221 Q321 Q421
AA 8.0 4.8 3.1 5.3
BB 0.6 0.7 0.3 0.9
NEW 1.3 0.0 1.2 0.0
Doing
mask = df['ID'].eq('BB')
df[NEW] = df.iloc[2,1:2].sum()
I am taking the sum row 2 and columns 1 and 2
Any suggestion is appreciated.