4.7.7.1.2.3.1.9. statsmodels.tools.grouputils.Grouping.sort

Grouping.sort(data, index=None)[source]

Applies a (potentially hierarchical) sort operation on a numpy array or pandas series/dataframe based on the grouping index or a user-supplied index. Returns an object of the same type as the original data as well as the matching (sorted) Pandas index.