1df = pd.DataFrame({'month': [1, 4, 7, 10],
2 'year': [2012, 2014, 2013, 2014],
3 'sale': [55, 40, 84, 31]})
4
5df.set_index('month')
1>>> df.set_index('month')
2 year sale
3month
41 2012 55
54 2014 40
67 2013 84
710 2014 31
8