pandas 0.8.1 documentation

pandas.DataFrame.sort_index

DataFrame.sort_index(axis=0, by=None, ascending=True, inplace=False)

Sort DataFrame either by labels (along either axis) or by the values in a column

Parameters :

axis : {0, 1}

Sort index/rows versus columns

by : object

Column name(s) in frame. Accepts a column name or a list or tuple for a nested sort.

ascending : boolean, default True

Sort ascending vs. descending

inplace : boolean, default False

Sort the DataFrame without creating a new instance

Returns :

sorted : DataFrame