title: How do I group date by month using pd.Grouper?
body: <p>I've searched stackoverflow to find out how to group DateTime by month and for some reason I keep receiving this error, even after I pass the dataframe through <code>pd.to.datetime</code></p>
  
  <blockquote>
    <p>TypeError: Only valid with DatetimeIndex, TimedeltaIndex or
    PeriodIndex, but got an instance of 'Int64Index'</p>
  </blockquote>
  
  <pre><code>df['Date'] = pd.to_datetime(df['Date'])
  df['Date'].groupby(pd.Grouper(freq='M'))
  </code></pre>
  
  <p>When I pull the datatype for <code>df['Date']</code> it shows <code>dtype: datetime64[ns]</code> Any, ideas why I keep getting this error?</p>