Использование crosstab
доgroupby
tail
pd.crosstab(df.Case,df.Action,normalize='index').stack().sort_values().groupby(level=0).tail(1)
Out[769]:
Case Action
Delete DeleteOldAccount 0.6
Create CreateNewAccount 0.8
dtype: float64
Или сделайте это с помощью where
pdf=pd.crosstab(df.Case,df.Action,normalize='index')
pdf.where(pdf.eq(pdf.max(1),axis=0)).stack()
Out[781]:
Case Action
Create CreateNewAccount 0.8
Delete DeleteOldAccount 0.6
dtype: float64