sorting - pandas groupby sort descending order -


pandas groupby default sort. i'd change sort order. how can this?

i'm guessing can't apply sort method returned groupby object.

do groupby, , use reset_index() make dataframe. sort.

grouped = df.groupby('mygroups').sum().reset_index() grouped.sort_values('mygroups', ascending=false) 

Comments

Popular posts from this blog

c# - how to use buttonedit in devexpress gridcontrol -

How do you convert a timestamp into a datetime in python with the correct timezone? -

how to display 2 form fields on same line with bootstrap -