title: Find equal columns between two dataframes
body: <p>I have two <code>pandas</code> data frames, <code>a</code> and <code>b</code>:</p>
  
  <pre><code>a1   a2   a3   a4   a5   a6   a7
  1    3    4    5    3    4    5
  0    2    0    3    0    2    1
  2    5    6    5    2    1    2
  </code></pre>
  
  <p>and</p>
  
  <pre><code>b1   b2   b3   b4   b5   b6   b7
  3    5    4    5    1    4    3
  0    1    2    3    0    0    2
  2    2    1    5    2    6    5
  </code></pre>
  
  <p>The two data frames contain exactly the same data, but in a different order and with different column names. Based on the numbers in the two data frames, I would like to be able to match each column name in <code>a</code> to each column name in <code>b</code>.</p>
  
  <p>It is not as easy as simply comparing the first row of <code>a</code> with the first row of <code>b</code> as there are duplicated values, for example both <code>a4</code> and <code>a7</code> have the value <code>5</code> so it is not possible to immediately match them to either <code>b2</code> or <code>b4</code>.</p>
  
  <p>What is the best way to do this?</p>