title: Compare two pandas dataframe with different size
body: <p>I have one massive pandas dataframe with this structure:</p>
  
  <pre><code>df1:
      A   B
  0   0  12
  1   0  15
  2   0  17
  3   0  18
  4   1  45
  5   1  78
  6   1  96
  7   1  32
  8   2  45
  9   2  78
  10  2  44
  11  2  10
  </code></pre>
  
  <p>And a second one, smaller like this:</p>
  
  <pre><code>df2
     G   H
  0  0  15
  1  1  45
  2  2  31
  </code></pre>
  
  <p>I want to add a column to my first dataframe following this rule: <code>column df1.C = df2.H when df1.A == df2.G</code></p>
  
  <p>I manage to do it with for loops, but the database is massive and the code run really slowly so I am looking for a Pandas-way or numpy to do it.</p>
  
  <p>Many thanks,</p>
  
  <p>Boris</p>