1# assignment copy
2df = df.set_index('month')
3
4# or inplace
5df.set_index('month', inplace=True)
6
7# year sale month month year sale
8# 0 2012 55 1 1 2012 55
9# 1 2014 40 4 => 4 2014 40
10# 2 2013 84 7 7 2013 84
11# 3 2014 31 10 10 2014 31