title: Remove days from pandas DatetimeIndex
body: <p>I'm working with dataset that has datetime info only for year-month as: 20110003 -> 2011-03. To retain the 2011-03 format I did the following: </p>
  
  <pre><code>#change 20110003 -&gt; 2011-03 
          indicator_ccgs_re=indicator_ccgs.loc[:,'Time period Sortable'].astype(str)
          old_pattern='00'
          new_pattern='-'
          new_dates=[]
          for i, v in indicator_ccgs_re.items():
              new_date = re.sub(old_pattern,new_pattern, v)
              new_dates=new_dates+[new_date]
          new_index=pd.to_datetime(new_dates,format='%Y%m%')
          values_period=indicator_ccgs.loc['2012-01':'2012-06','Value']
          type(new_index)
  </code></pre>
  
  <p>pandas.core.indexes.datetimes.DatetimeIndex</p>
  
  <pre><code>values_period.index
  
  DatetimeIndex(['2012-01-01', '2012-02-01', '2012-03-01', '2012-04-01',
                 '2012-05-01', '2012-06-01'],
                dtype='datetime64[ns]', freq=None)
  </code></pre>
  
  <p>So the day remains even though I specified format='%Y%m%'.</p>
  
  <p>When plotting the values are monthly but tabular output still retains the days in the index.</p>
  
  <p>I tried resampling </p>
  
  <pre><code>monthly=values_period.resample('M').sum()
  monthly.index
  </code></pre>
  
  <p>But the days remain (only last rather than first month day):</p>
  
  <pre><code>DatetimeIndex(['2012-01-31', '2012-02-29', '2012-03-31', '2012-04-30',
                 '2012-05-31', '2012-06-30'],
                dtype='datetime64[ns]', freq='M')
  </code></pre>
  
  <p>And trying: </p>
  
  <pre><code>dt=new_index.strptime('%Y-%m')
  </code></pre>
  
  <p>I got AttributeError: 'DatetimeIndex' object has no attribute 'strptime'</p>
  
  <p>Any other solution to reomove the day from the index? </p>