pandas 0.9.0 documentation

pandas.DataFrame.sortlevel

DataFrame.sortlevel(level=0, axis=0, ascending=True)

Sort multilevel index by chosen axis and primary level. Data will be lexicographically sorted by the chosen level followed by the other levels (in order)

Parameters :

level : int

axis : {0, 1}

ascending : bool, default True

Returns :

sorted : DataFrame