title: numpy: check for 1 every 6 element every row
body: <p>I need to have something like this:</p>
  
  <pre><code>arr = array([[1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0,
          0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0],
         [0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
          0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0],
         [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
          0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
         [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
          0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0],
         [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
          0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0],
         [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1,
          0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0]])
  </code></pre>
  
  <p>Where each row contains 36 elements, every 6 element in a row represents a hidden row, and that hidden row needs exactly one <code>1</code>, and <code>0</code> everywhere else. In other words, every entry mod 6 needs exactly one <code>1</code>. This is my requirement for <code>arr</code>.</p>
  
  <hr>
  
  <p>I have a table that's going to be used to compute a "fitness" value for each row. That is, I have a</p>
  
  <pre><code>table = np.array([10, 5, 4, 6, 5, 1, 6, 4, 9, 7, 3, 2, 1, 8, 3,
                            6, 4, 6, 5, 3, 7, 2, 1, 4, 3, 2, 5, 6, 8, 7, 7, 6, 4, 1, 3, 2])
  table = table.T
  </code></pre>
  
  <p>and I'm going to multiply each row of <code>arr</code> with <code>table</code>. The result of that multiplication, a <code>1x1</code> matrix, will be stored as the "fitness" value of that corresponding row. <strong>UNLESS</strong> the row does not fit the requirement described above, which should return 0.</p>
  
  <p>an example of what should be returned is</p>
  
  <pre><code>result = array([5,12,13,14,20,34])
  </code></pre>
  
  <p>I need a way to do this but I'm too new to numpy to know how to. </p>