title: Averaging over every n elements of a numpy array
body: <p>I have a numpy array. I want to create a new array which is the average over every consecutive triplet of elements. So the new array will be a third of the size as the original.  </p>
  
  <p>As an example:</p>
  
  <pre><code> np.array([1,2,3,1,2,3,1,2,3])
  </code></pre>
  
  <p>should return the array:</p>
  
  <pre><code> np.array([2,2,2])
  </code></pre>
  
  <p>Can anyone suggest an efficient way of doing this? I'm drawing blanks.</p>