title: Pandas groupby aggregation to truncate earliest date instead of oldest date
body: <p>I'm trying to aggregate from the end of a date range instead of from the beginning. Despite the fact that I would think that adding <code>closed='right'</code> to the grouper would solve the issue, it doesn't. Please let me know how I can achieve my desired output shown at the bottom, thanks. </p>
  
  <pre><code>import pandas as pd
  df = pd.DataFrame(columns=['date','number'])
  df['date'] = pd.date_range('1/1/2000', periods=8, freq='T')
  df['number'] = pd.Series(range(8))
  df
  
      date                number
  0   2000-01-01 00:00:00 0
  1   2000-01-01 00:01:00 1
  2   2000-01-01 00:02:00 2
  3   2000-01-01 00:03:00 3
  4   2000-01-01 00:04:00 4
  5   2000-01-01 00:05:00 5
  6   2000-01-01 00:06:00 6
  7   2000-01-01 00:07:00 7
  </code></pre>
  
  <p>With the groupby and aggregation of the date I get the following. Since I have 8 dates and I'm grouping by periods of 3 it must choose whether to truncate the earliest date group or the oldest date group, and it chooses the oldest date group (the oldest date group has a count of 2):</p>
  
  <pre><code>df.groupby(pd.Grouper(key='date', freq='3T')).agg('count')
  
  date                number
  2000-01-01 00:00:00 3
  2000-01-01 00:03:00 3
  2000-01-01 00:06:00 2
  </code></pre>
  
  <p>My desired output is to instead truncate the <em>earliest</em> date group: </p>
  
  <pre><code>date                number
  2000-01-01 00:00:00 2
  2000-01-01 00:02:00 3
  2000-01-01 00:05:00 3
  </code></pre>
  
  <p>Please let me know how this can be achieved, I'm hopeful there's just a parameter that can be set that I've overlooked. Note that this is similar to <a href="https://stackoverflow.com/questions/48340463/how-to-understand-closed-and-label-arguments-in-pandas-resample-method">this</a> question, but my question is specific to the date truncation.</p>
  
  <p>EDIT: To reframe the question (thanks Alexdor) the default behavior in pandas is to bin by period [0, 3), [3, 6), [6, 9) but instead I'd like to bin by (-1, 2], (2, 5], (5, 8] </p>