1>>> df = pd.DataFrame([1, 2, 3, 4, 5], index=[100, 29, 234, 1, 150],
2... columns=['A'])
3>>> df.sort_index()
4 A
51 4
629 2
7100 1
8150 5
9234 3
10
1import pandas as pd
2import numpy as np
3
4unsorted_df = pd.DataFrame(np.random.randn(10,2),index=[1,4,6,2,3,5,9,8,0,7],colu
5 mns = ['col2','col1'])
6
7sorted_df=unsorted_df.sort_index()
8print sorted_df