title: Get indices of intersecting rows of Numpy 2d Array
body: <p>I want to get the indices of the intersecting rows of a main numpy 2d array A, with another one B.</p>
  
  <pre><code>A=array([[1, 2],
           [3, 4],
           [5, 6],
           [7, 8],
           [9, 10]])
  
  B=array([[1, 4],
           [1, 2],
           [5, 6],
           [6, 3]])
  
  result=[0,2]
  </code></pre>
  
  <p>Where this should return [0,2] based on the indices of array A.</p>
  
  <p>How can this be done efficiently for 2d arrays?</p>
  
  <p>Thank you!</p>
  
  <p><strong>edit</strong></p>
  
  <p>I have tried the function:</p>
  
  <pre><code>k[np.in1d(k.view(dtype='i,i').reshape(k.shape[0]),k2.view(dtype='i,i').
  reshape(k2.shape[0]))]
  </code></pre>
  
  <p>from <a href="https://stackoverflow.com/questions/16210738/numpy-in1d-for-2d-arrays">Implementation of numpy in1d for 2D arrays?</a> but I get a reshape error. My datatype is floats (with two decimals).
  Moreover, I also tried with sets but the performance is quite slow.</p>