title: Comparing rows in 2 dataframes and counting number of similar columns
body: <p>I have two dataframes </p>
  
  <pre><code>&gt;&gt; df1
  ID  Hair  Legs  Feathers
   1    1     0      0
   2    1     2      1
   3    0     2      1
  
  &gt;&gt; df2
  ID  Hair  Legs  Feathers
  21   1      2     0
  22   1      0     1
  </code></pre>
  
  <p>I want to compare each row in <code>df2</code> with all the rows in <code>df1</code> and count the number of columns that are similar in each row of <code>df2</code> in such a manner that it gives the following dataframe <code>df3</code></p>
  
  <pre><code>&gt;&gt; df3
  ID    Hair  Legs  Feathers  Count
  1-21   1      2      0        2
  2-21   1      2      0        2
  3-12   1      2      0        1
  1-22   1      0      1        2
  2-22   1      0      1        2
  3-22   1      0      1        1
  </code></pre>
  
  <p>The <code>Count</code> is calculated in such a manner that the first row of <code>df2</code> is compared with the first row of <code>df1</code> and the number of similar columns are calculated. Similarly between the first row of <code>df2</code> with second row of <code>df1</code> and so on. Moreover, the second row of <code>df2</code> is compared with all the rows of <code>df1</code> one by one and stored in another dataframe <code>df3</code>.</p>
  
  <p>Any help will be highly appreciated</p>