title: Index of matching rows in Pandas DataFrame [Python]
body: <p>I have two Pandas DataFrames (<code>A</code> and <code>B</code>) with 2 columns and different number of rows.<br>
  They used to be numpy 2D matrices and they both contain integer values.<br>
  Is there any way to retrieve the indices of matching rows between those two?</p>
  
  <p>I've been trying <code>isin()</code> or <code>query()</code> or <code>merge()</code>, without success. </p>
  
  <p>This is actually a follow-up to a previous <a href="https://stackoverflow.com/questions/37534466/check-whether-each-row-of-a-matrix-is-in-another-matrix-python">question</a>: I'm trying with pandas dataframes since the original matrices are rather huge.</p>
  
  <p>The desired output, if possible, should be an array (or list) containing in i-th position the row index in <code>B</code> for the i-th row of <code>A</code>. E.g an output list of <code>[1,5,4]</code> means that the first row of <code>A</code> has been found in first row of <code>B</code>, the second row of <code>A</code> has been found in fifth row in <code>B</code> and the third row of <code>A</code> has been found in forth row in <code>B</code>.</p>