title: Pandas monthly rolling operation
body: <p>I ended up figuring it out while writing out this question so I'll just post anyway and answer my own question in case someone else needs a little help.</p>
  
  <h2>Problem</h2>
  
  <p>Suppose we have a <code>DataFrame</code>, <code>df</code>, containing this data. </p>
  
  <pre><code>import pandas as pd
  from io import StringIO
  
  data = StringIO(
  """\
  date          spendings  category
  2014-03-25    10         A
  2014-04-05    20         A
  2014-04-15    10         A
  2014-04-25    10         B
  2014-05-05    10         B
  2014-05-15    10         A
  2014-05-25    10         A
  """
  )
  
  df = pd.read_csv(data,sep="\s+",parse_dates=True,index_col="date")
  </code></pre>
  
  <h2>Goal</h2>
  
  <p>For each row, sum the <code>spendings</code> over every row that is within <strong>one month</strong> of it, ideally using <code>DataFrame.rolling</code> as it's a very clean syntax.</p>
  
  <h2>What I have tried</h2>
  
  <pre><code>df = df.rolling("M").sum()
  </code></pre>
  
  <p>But this throws an exception</p>
  
  <pre><code>ValueError: &lt;MonthEnd&gt; is a non-fixed frequency
  </code></pre>
  
  <p>version: <code>pandas==0.19.2</code></p>