title: How to create rolling window variables without skipping months when using a multiIndex?
body: <p>Currently I have a df with a location_key &amp; year_month multiIndex. I want to create a sum using a rolling window for 3 months.</p>
  
  <pre><code>(pd.DataFrame(df.groupby(['LOCATION_KEY','YEAR_MONTH'])['SALES'].count()).sort_index()).groupby(level=(0)).apply(lambda x: x.rolling(window=3).sum())
  </code></pre>
  
  <p>The window is working properly the issue is that in months where there were no sales instead of counting an empty month instead it counts the another month.</p>
  
  <p>e.g. in the data below, 2016-03 Sales is the sum of 2016-03, 2016-01, 2015-12 as opposed to what I would like: 2016-03, 2016-02, 2016-01.</p>
  
  <p><code>
  LOCATION_KE YEAR_MONTH SALES
  A           2015-10 NaN
              2015-11 NaN
              2015-12 200
              2016-01 220
              2016-03 180
  B           2015-04 NaN
              2015-05 NaN
              2015-06 119
              2015-07 120</code></p>