title: Creating datetime object in pandas from out of order dates
body: <p>I have a dataframe in pandas that looks like this </p>
  
  <pre><code>Year Month Month_index Rainfall
  1900 Jan   1            4.8
  1901 Jan   1            5
  .
  .
  .
  1900 Feb   2            3.2
  1901 Feb   2            4.3
  .
  .
  </code></pre>
  
  <p>To use datetime indexing I need to rearrange it to look like -</p>
  
  <pre><code>Year Month Month_index Rainfall
  1900 Jan   1            4.8
  1900 Feb   2            3.2
  .
  .
  1901 Jan   1            5
  1901 Feb   2            4.3
  .
  .
  </code></pre>
  
  <p>Of course there are the full 12 months I'm just showing a little bit for brevity. I'm reasonably new to python so I don't know if there is a command that will do this. 
  Thank you in advance! </p>
  
  <p>edit: Here is the code I'm using to get thus far - </p>
  
  <pre><code>import csv
  #import pyexcel-io as pi
  import numpy as np
  import pandas as pd
  import dateutil
  #Read data from csv file into dataframe
  df =pd.read_csv('/Users/Gingeraffe/Documents/University/3rd_year/Bureau_Research/Notebooks/Data/rainfall_SW_WA.csv')
  
  months = df.columns[1:]
  #Melt is putting months down a column and the data down another column. 
  Problem is ' jan jan jan... feb feb feb..' etc. instead of 'jan feb mar.. etc'
  df = pd.melt(df, id_vars='Year', value_vars=months, var_name='Month')
  df.insert(2,'Month_index',0)
  M = {'Jan':1, 'Feb':2, 'Mar':3, 'Apr':4, 'May':5, 'June':6, 'July':7, 'Aug':8, 'Sep':9, 'Oct':10, 'Nov':11, 'Dec':12}
  df.Month_index = df.Month.map(M) 
  </code></pre>