title: Numpy where() on a 2D matrix
body: <p>I have a matrix like this</p>
  
  <pre><code>t = np.array([[1,2,3,'foo'],
   [2,3,4,'bar'],
   [5,6,7,'hello'],
   [8,9,1,'bar']])
  </code></pre>
  
  <p>I want to get the indices where the rows contain the string 'bar'</p>
  
  <p>In a 1d array</p>
  
  <pre><code>rows = np.where(t == 'bar')
  </code></pre>
  
  <p>should give me the indices [0,3] followed by broadcasting:-</p>
  
  <pre><code>results = t[rows]
  </code></pre>
  
  <p>should give me the right rows</p>
  
  <p>But I can't figure out how to get it to work with 2d arrays.</p>