title: Pandas resample time series counting backwards (or reverse resample)
body: <p>I want to resample a pandas time series counting backwards. For example, let's set up a simple time series of 11 days:</p>
  
  <pre><code>&gt;&gt;&gt; index = pd.date_range('01-01-2018', '01-11-2018', freq='D')
  &gt;&gt;&gt; randint = np.random.randint(low=0, high=9, size=(len(index), 1))
  
  &gt;&gt;&gt; df = pd.DataFrame(randint, index=index, columns=['random'])
  &gt;&gt;&gt; print(df)
  
              random
  2018-01-01       8
  2018-01-02       8
  2018-01-03       1
  2018-01-04       4
  2018-01-05       3
  2018-01-06       5
  2018-01-07       2
  2018-01-08       6
  2018-01-09       5
  2018-01-10       1
  2018-01-11       3
  </code></pre>
  
  <h1>Default pandas behavior</h1>
  
  <p>If I resample it every 5 days, I'd get:</p>
  
  <pre><code>&gt;&gt;&gt; df_5d = df.resample('5D').sum()
  &gt;&gt;&gt; print(df_5d)
  
              random
  2018-01-01      24
  2018-01-06      19
  2018-01-11       3
  </code></pre>
  
  <p>Basically you have 3 groupings: the first two groups have 5 members and the last group has 1, for a total of 11 members overall:</p>
  
  <pre><code>Start        End
  2018-01-01   2018-01-05
  2018-01-06   2018-01-10
  2018-01-11   2018-01-11
  </code></pre>
  
  <h1>What I want is this</h1>
  
  <pre><code>&gt;&gt;&gt; df_5d = df.resample('5D').sum()
  &gt;&gt;&gt; print(df_5d)
  
              random
  2018-01-01       8
  2018-01-02      21
  2018-01-07      17
  </code></pre>
  
  <p>And the groupings are shown below. See how I counted <code>'5D'</code> backwards starting from the latest date:</p>
  
  <pre><code>Start        End
  2018-01-01   2018-01-01
  2018-01-02   2018-01-06
  2018-01-07   2018-01-11
  </code></pre>
  
  <p>How do I resample a pandas time series counting backwards?</p>