pandas.Series.sortlevel

Series.sortlevel(level=0, ascending=True)

Sort Series with MultiIndex by chosen level. Data will be lexicographically sorted by the chosen level followed by the other levels (in order)

Parameters :

level : int

ascending : bool, default True

Returns :

sorted : Series