title: Finding the average of n consecutive rows in pandas and add as another column in same Data Frame
body: <p>I have a Data Frame something like this.</p>
  <pre><code>+-----------------+-------+
  |   Time Stamp    | Value |
  +-----------------+-------+
  | 11/18/2020 6:06 |     2 |
  | 11/18/2020 6:06 |    19 |
  | 11/18/2020 6:06 |     1 |
  | 11/18/2020 6:06 |    21 |
  | 11/18/2020 6:06 |     2 |
  | 11/18/2020 6:07 |    52 |
  | 11/18/2020 6:07 |     0 |
  | 11/18/2020 6:08 |    20 |
  | 11/18/2020 6:08 |     2 |
  | 11/18/2020 6:08 |    20 |
  | 11/18/2020 6:08 |     1 |
  | 11/18/2020 6:08 |    19 |
  | 11/18/2020 6:08 |     1 |
  | 11/18/2020 6:09 |    20 |
  | 11/18/2020 6:09 |     1 |
  +-----------------+-------+
  </code></pre>
  <p>I want to add a new column to the Data Frame that contains the average of 4 consecutive values (each repeated 4 times) like this.</p>
  <pre><code>+-----------------+-------+------+
  |   Time Stamp    | Value | Avg  |
  +-----------------+-------+------+
  | 11/18/2020 6:06 |     2 | 10.7 |
  | 11/18/2020 6:06 |    19 | 10.7 |
  | 11/18/2020 6:06 |     1 | 10.7 |
  | 11/18/2020 6:06 |    21 | 10.7 |
  | 11/18/2020 6:06 |     2 | 18.5 |
  | 11/18/2020 6:07 |    52 | 18.5 |
  | 11/18/2020 6:07 |     0 | 18.5 |
  | 11/18/2020 6:08 |    20 | 18.5 |
  | 11/18/2020 6:08 |     2 | 10.5 |
  | 11/18/2020 6:08 |    20 | 10.5 |
  | 11/18/2020 6:08 |     1 | 10.5 |
  | 11/18/2020 6:08 |    19 | 10.5 |
  | 11/18/2020 6:08 |     1 |  7.3 |
  | 11/18/2020 6:09 |    20 |  7.3 |
  | 11/18/2020 6:09 |     1 |  7.3 |
  +-----------------+-------+------+
  </code></pre>
  <p>What is the easiest way to achieve this?</p>
  <p>I have tried something like the answer in this <a href="https://stackoverflow.com/questions/36810595/calculate-average-of-every-x-rows-in-a-table-and-create-new-table">link</a>. But I couldn't Figure out how to add the average column back to the same Data Frame.</p>