title: Making a list of months and years from DatetimeIndex in Pandas
body: <p>I have a dataframe of information. I set the index to be the received date and time. Now I want a list </p>
  
  <p>I set the df index doing this: </p>
  
  <pre><code>df.index = pd.to_datetime(df.index, format='%m/%d/%Y %H:%M')
  </code></pre>
  
  <p>which gives me this:</p>
  
  <pre><code>print df.index
  &lt;class 'pandas.tseries.index.DatetimeIndex'&gt;
  [2014-07-28 09:42:08, ..., 2015-07-28 09:06:12]
  Length: 15177, Freq: None, Timezone: None
  </code></pre>
  
  <p>I want a list of the month and years in order to use them to plot, like so: <code>["Jan 2015", "Feb 2015", "Mar 2015", "Apr 2015", "May 2015", "June 2015", "Jul 2015", "Aug 2014", "Sep 2014", "Oct 2014", "Nov 2014", "Dec 2014"]</code></p>
  
  <p>How can I do this? I've looked into something like this: </p>
  
  <pre><code>df = [datetime.datetime.strftime(n,'%b-%Y') for n in pd.DataFrame(df).resample('M').index] 
  </code></pre>
  
  <p>But this gives me the error <code>DataError: No numeric types to aggregate</code>.</p>