title: Is there a numpy.where() equivalent for row-wise operations?
body: <p>I want to find the index of first occurence of some condition row-wise, such that it returns a vector. I would need something like an <code>axis=0</code> condition in <code>np.where</code> or the <code>pylab</code> <code>find</code> function, but that is not implemented.</p>
  
  <p>To clarify, imagine I have the following matrix:</p>
  
  <pre><code>d=np.array([[0,  1, 0, 1], [0, 1, 1, 1], [1, 0, 0, 0], [0,0,0,1]])
  </code></pre>
  
  <p>I want the first occurrence of <code>d==1</code> row wise.</p>
  
  <p>The result should be <code>[1, 1, 0, 3]</code>, but I don't see how to do this with <code>np.where</code> or any other function efficiently.</p>