I am a pandas beginner and in need of some help.
I have the following pandas dataframe:
ID Val-A Val-B
aab12 lower -30
dbc11 lower -10
aab12 upper 50
dbc11 upper 20
I want to produce a new dataframe from the previous one and can't think of a way to do it:
ID Val-A Val-B upper-lower
aab12 lower -30 80
aab12 upper 50 80
dbc11 lower -10 30
dbc11 upper 20 30
Any help will be highly appreciated!