title: pandas merge matching different rows
body: <p>I have two data frames with some item (a,b,c..) names in old version and new version in different orders. Here old_a and new_a are different words (example <code>old_a='cat', new_a='dog'</code>). Very simplified;</p>
  
  <p><a href="https://i.stack.imgur.com/n8ya2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n8ya2.png" alt="enter image description here"></a></p>
  
  <p>I would like to get the data frame below;</p>
  
  <p><a href="https://i.stack.imgur.com/EFw8C.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EFw8C.png" alt="enter image description here"></a></p>
  
  <p>I can find the corresponding indexes by</p>
  
  <pre><code>df= pd.merge(df1.reset_index(), df2.reset_index(), on=['names'])
  </code></pre>
  
  <p>But this gives me the below df, how do i get from here to desired above data frame?</p>
  
  <p><a href="https://i.stack.imgur.com/WyKBW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WyKBW.png" alt="enter image description here"></a></p>