title: Pandas Rolling On DateTime Multi Index Frame
body: <p>There are similar questions, but my <code>datetime</code> objects are very spatial and not ordered e.g. they are random timestamps in time. Basically what I need is to use <code>rolling()</code> but roll it over the 2nd index while remembering the group (1st index).</p>
  
  <p>There is a very similar GitHub issue that you might also want to contribute to:
  <a href="https://github.com/pandas-dev/pandas/issues/15584" rel="noreferrer">https://github.com/pandas-dev/pandas/issues/15584</a></p>
  
  <p>Code to reproduce:</p>
  
  <pre><code>import pandas as pd
  data = {
      'id': ['A','A','A','B'],
      'time': pd.to_datetime(['2018-01-04 08:13:51.181','2018-01-04 08:13:55.181','2018-01-04 09:13:51.181', '2018-01-04 08:13:51.183']),
      'colA': [4,3,2,1],
      '30min_rolling_output': [4,7,2,1],
      '1day_rolling_output': [4,7,9,1]
  }
  test_df = pd.DataFrame(data=data).set_index(['id', 'time'])
  </code></pre>
  
  <p>The desired output is assuming the <code>30m</code> and <code>1h</code> arguments.</p>
  
  <p>Visualising:</p>
  
  <pre><code>                            colA  30min_rolling_output  1day_rolling_output
  id date                                                          
  A  2018-01-04 08:13:51.181     4                     4                    4
     2018-01-04 08:13:55.181     3                     7                    7
     2018-01-04 09:13:51.181     2                     2                    9
  B  2018-01-04 08:13:51.183     1                     1                    1
  </code></pre>