I am trying to sort the output of describe()
with count. Not sure, how to solve.
Tried sort_by
and .loc
but none of it serves the purpose of sorting the output of describe.
Need to edit the below line of code:
df.groupby("Disease_Category")['Approved_Amt'].describe().reset_index()
Current Output
Disease_Category count mean std min 25% 50% 75% max
1 Disease1 5.0 82477.600000 51744.487632 30461.0 58318.00 72201.0 83408.00 168000.0
2 Disease2 190.0 35357.163158 46268.552683 1707.0 13996.25 22186.0 36281.75 331835.0
Desired Output
Disease_Category count mean std min 25% 50% 75% max
1 Disease2 190.0 35357.163158 46268.552683 1707.0 13996.25 22186.0 36281.75 331835.0
2 Disease1 5.0 82477.600000 51744.487632 30461.0 58318.00 72201.0 83408.00 168000.0