title: Fast way to take average of every N rows in a .npy array
body: <p>I have a very large masked NumPy array (<code>originalArray</code>) with many rows and two columns.  I want take the average of every two rows in <code>originalArray</code> and build a <code>newArray</code> in which each row is the average of two rows in <code>originalArray</code> (so <code>newArray</code> has half as many rows as <code>originalArray</code>).  This should be a simple thing to do, but the script below is EXTREMELY slow.  Any advice from the community would be greatly appreciated.</p>
  
  <pre><code>newList = []
  for i in range(0, originalArray.shape[0], 2):
      r = originalArray[i:i+2,:].mean(axis=0)
      newList.append(r)
  newArray = np.asarray(newList)
  </code></pre>
  
  <p>There must be a more elegant way of doing this.  Many thanks!</p>