title: Pandas cut or groupby a date range
body: <p>I have multiple dataframes with a date column. I want to groupby these dataframes by the date column by 5 days. Normally something like this works: </p>
  
  <pre><code>df = pd.DataFrame([['2016-11-01 09:21:07', 10], ['2016-09-14 02:46:01', 21], ['2016-08-11 03:26:33', 14], ['2016-10-17 14:20:44', 14]], 
                  columns=['DateCol', 'Values'])
  df['DateCol'] = pd.to_datetime(df['DateCol'])
  
  df.set_index('DateCol').groupby(pd.TimeGrouper('5D')).mean()
  </code></pre>
  
  <p>However, when I use <code>pd.TimeGrouper</code> it creates groups based on the dataframe I apply it to. If I do this on two different dataframes it yields different groups.
  I want to group multiple dataframes by the same groups.</p>
  
  <p>I tried using <code>pd.cut</code> but it doesn't work with datetime columns. <code>pd.cut(df['DateCol'], 10)</code> gives me <code>TypeError</code>.</p>
  
  <p>Ideally I want to do something like this:</p>
  
  <pre><code>pd.groupby(df, pd.cut(df['DateCol'], pd.date_range(start='1/1/2016', end='1/1/2017', freq='5D')))
  </code></pre>
  
  <p>In other words, I need to groupby my dataframe by a specific date range.</p>