title: Shrink the dataset by taking mean or median
body: <p>Assuming I have the following dataframe <code>df</code>:</p>
  <pre><code>Number     Apples
  1            40
  2            50
  3            60
  4            70
  5            80
  6            90
  7            100
  8            110
  9            120
  </code></pre>
  <p>I want to shrink this dataset and create dataframe <code>df2</code> such that there are only 3 observations. Hence, I want to take the average of 1,2,3 and make that one row, then 4,5,6 and make that the second row, and finally, 7,8,9 and make that the 3rd row</p>
  <p>The end result will be the following</p>
  <pre><code>Number     Apples
  1            50
  2            80
  3            110
  </code></pre>