title: Pandas match data between to dataframes with row as key
body: <p>so let's say that I have two dataframes, df1 - which contains more columns, but only column A is relevant in this question:</p>
  <pre><code>   A
    a1
    a2
    a3
    a4
  </code></pre>
  <p>and so on and so on. In the second dataframe, df2, column A contains exactly the same records as the column A in df1, <strong>however</strong> they are shuffled:</p>
  <pre><code>   A   B
     a3  2
     a1  5
     a4  3
     a2  4
  </code></pre>
  <p>and so on. The way they're shuffled isn't known. Now what I want to do is to get a dataframe, which would be somehow &quot;merged&quot; in a way that, keeping the order from df1, match the values of the second dataframe. So basing on the above examples the output would be:</p>
  <pre><code>   A   B 
     a1  5
     a2  4
     a3  2
     a4  3
  </code></pre>
  <p>The values in column &quot;A&quot; are not easily &quot;orderable&quot;. How can I achieve such a frame? Thanks in advance!</p>