title: How to downsample a pandas dataframe by 2x2 averaging kernel
body: <p>I am trying to downsample a pandas dataframe in order to reduce granularity. In example, I want to reduce this dataframe:</p>
  
  <pre><code>1  2  3  4
  2  4  3  3
  2  2  1  3
  3  1  3  2
  </code></pre>
  
  <p>to this (downsampling to obtain a 2x2 dataframe using mean):</p>
  
  <pre><code>2.25  3.25
  2     2.25
  </code></pre>
  
  <p>Is there a builtin way or efficient way to do it or I have to write it on my own?</p>
  
  <p>Thanks</p>