MultiIndex.sortlevel()
pandas.MultiIndex.sortlevel
-
MultiIndex.sortlevel(level=0, ascending=True, sort_remaining=True)
-
Sort MultiIndex at the requested level. The result will respect the original ordering of the associated factor at that level.
Parameters: level : list-like, int or str, default 0
If a string is given, must be a name of the level If list-like must be names or ints of levels.
ascending : boolean, default True
False to sort in descending order Can also be a list to specify a directed ordering
sort_remaining : sort by the remaining levels after level.
Returns: sorted_index : MultiIndex
© 2011–2012 Lambda Foundry, Inc. and PyData Development Team
© 2008–2011 AQR Capital Management, LLC
© 2008–2014 the pandas development team
Licensed under the 3-clause BSD License.
http://pandas.pydata.org/pandas-docs/version/0.18.1/generated/pandas.MultiIndex.sortlevel.html