I have Pandas Dataframe which look like this:
feat_1 feat_2 feat_3 ... ...
target 10 23 15
UL 0.5 4 7
LL -0.5 -4 -7
Where UL and LL stands for upper and lower limit and this is index. I want in loop replace values of those with calculated limits like this:
for col in df.columns:
UL = df[column].loc['target'] + df[column].loc['UL']
LL = df[column].loc['target'] + df[column].loc['LL']
???
So my desired output would look like this:
feat_1 feat_2 feat_3 ... ...
target 10 23 15
UL 10.5 27 22
LL 9.5 19 8