this is the dataframe
name team stat1 stat2
a aa 1 4
b aa 2 3
c bb 3 2
d bb 4 1
want to calculate a new variable which is calculated
-> (( stat1 of player 'a' / sum of stat1 for that team ) + ( stat2 of player 'a' / sum of stat2 for that team ))
-> ((1/1+2) + (4/4+3))
any idea on how to do this?