I obtained a multi index in pandas by running series.describe() for a grouped dataframe. How can I sort these series by modelName.mean
and only keep sepcific fields?
This
summary.sortlevel(1)['kappa']
sorts them but retains all the other fields like count. How can I only keep mean
and std
?
edit
this is a textual representation of the df.
kappa
modelName
biasTotal count 5.000000
mean 0.526183
std 0.013429
min 0.507536
25% 0.519706
50% 0.525565
75% 0.538931
max 0.539175
biasTotalWithDistanceMetricAccount count 5.000000
mean 0.527275
std 0.014218
min 0.506428
25% 0.520438
50% 0.529771
75% 0.538475
max 0.541262
lightGBMbiasTotal count 5.000000
mean 0.531639
std 0.013819
min 0.513363