I have a pandas data frame with a two column multi index, as seen below
var
var1 var2
0 1 3
1 2 4
Would it be possible to create a new 3rd column index, the first (mean) would be the original data and the second would have a function applied to it for example .rank()
var
var1 var2
mean rank mean rank
0 1 0.5 3 0.5
1 2 1 4 1