title: Count number of trues in a numpy array in each row?
body: <p>I have a numpy array and I want to return the count of <code>true</code> values for each row.</p>
  
  <p>for example I have a numpy array:</p>
  
  <pre><code>[[False False False ..., False False False]
   [False False False ..., False False False]
   [False False False ..., False  True False]
   ..., 
   [False False False ..., False False False]
   [ True False  True ...,  True  True  True]
   [False False False ..., False False False]]
  </code></pre>
  
  <p>and the return value should be like:</p>
  
  <pre><code>[10
   15
   8
   ..., 
   11
   10
   12]
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/8364674/python-numpy-how-to-count-the-number-of-true-elements-in-a-bool-array">This question asks about how to do it for the whole array</a> but how do I do it for each row?</p>