title: How to get sum of k consecutive rows in pandas dataframe?
body: <p>I have this pandas dataframe:</p>
  <pre><code>ts = pd.Series([1, 2, 3, 4, 5, 6, 7, 8])
  </code></pre>
  <p>What I would like to get is a dataframe which contains another column with the sum of four consecutive rows of <code>ts</code>. The sum should be put in every row of the consecutive rows.</p>
  <p>In this case, this means a new dataframe should look like this one:</p>
  <pre><code>index ts sum
  0 1 10
  1 2 10
  2 3 10
  3 4 10
  4 5 26
  5 6 26
  6 7 26
  7 8 26
  </code></pre>
  <p>How could I do this?</p>