title: Sum of groups of four in a matrix
body: <p>I have the following matrix: first column are the values of 1 to 5, second column is 1 to 20, and the third column are random values.</p>
  
  <pre><code>1   1   2545
  1   2   0
  1   3   0
  1   4   0
  2   5   0
  2   6   0
  2   7   231
  2   8   54587
  3   9   41
  3   10  1111
  3   11  0
  3   12  1213
  4   13  0
  4   14  0
  4   15  0
  4   16  0
  5   17  898
  5   18  6887
  5   19  522
  5   20  23    
  </code></pre>
  
  <p>What I am trying to do is  to get the sum in groups of four when all values are different of zero. As an example, in the matrix the output I want is:</p>
  
  <pre><code>1   NaN
  2   NaN
  3   NaN
  4   NaN
  5   8330
  </code></pre>