title: Pandas groupby range, allow duplicates
body: <p>Say I have a dataframe that looks like this:</p>
  
  <pre><code>char  |  num
  -----------------
  A     |  1
  B     |  2
  C     |  3
  D     |  4
  E     |  5
  </code></pre>
  
  <p>Is there a way to make a groupby object that will use a range of say 3 for 'num' to create groups like this:</p>
  
  <p>Group 1:</p>
  
  <pre><code>char  |  num
  -----------------
  A     |  1
  B     |  2
  C     |  3
  </code></pre>
  
  <p>Group 2:</p>
  
  <pre><code>char  |  num
  -----------------
  B     |  2
  C     |  3
  D     |  4
  </code></pre>
  
  <p>Group 3:</p>
  
  <pre><code>char  |  num
  -----------------
  C     |  3
  D     |  4
  E     |  5
  </code></pre>
  
  <p>Rows would obviously be duplicated, but this is the result that I'm going for. I can think of some brute-force ways to achieve this, but I'm fishing for a elegant solution if it's out there.</p>