title: Apply numpy nonzero row-wise?
body: <p>I have a 2d boolean array from which I'm trying to extract the indices of the true values. Numpy's nonzero function decomposes my 2d array into a list of x's and y's of positions, which is problematic. </p>
  
  <p>Is it possible to find the column indices of the <code>true</code> elements while preserving the row order?</p>
  
  <p>Each of the true values in the columns are associated with each other in the same row so splitting them into (row index, column index) pairs isn't helpful. Is this possible?</p>
  
  <p>I was thinking that maybe <code>np.apply_along_axis</code> maybe useful.  </p>