title: Efficient way to match coordinates in 2d array
body: <p>I have a 2d array of coordinates and I want to find the index of the entry that matches a given coordinate.</p>
  
  <p>For example, my array could be <code>A</code>:</p>
  
  <pre><code>A = [[[1.5, 2.0], [1.0, 2.3], [5.4, 2.3]],
       [[3.2, 4.4], [2.0, 3.1], [0.0, 2.3]],
       [[1.0, 2.0], [2.3, 3.4], [4.0, 1.1]]]
  </code></pre>
  
  <p>and the coordinate I want to match is <code>x = [1.0, 2.0]</code>. I want to get the index of the coordinate <code>[1.0, 2.0]</code>, which would be <code>(2, 0)</code>.</p>
  
  <p>Currently I am doing it as follows:</p>
  
  <pre><code>matching_inds = [(i, j) for i in xrange(len(A)) for j in xrange(len(A[0])) if A[i,j][0] == x[0] and A[i,j][1] == x[1]]
  </code></pre>
  
  <p>This works, but I feel like there should be something more efficient (the arrays I'm working with are much larger).</p>
  
  <p>I tried <code>np.where()</code> but that doesn't seem to work too well with higher dimensions. It would return indices for all coordinates where the x-coordinate matched, not the x- and y-coordinates.</p>
  
  <p>Any tips would be appreciated.</p>