"Python, pandas: how to sort dataframe by index",df.sort_index(inplace=True)