title: How to Compare Values of two Dataframes in Pandas?
body: <p>I have two dataframes <code>df</code> and <code>df2</code> like this</p>
  
  <pre><code>    id  initials
  0   100 J
  1   200 S
  2   300 Y
  
      name  initials
  0   John   J
  1   Smith  S
  2   Nathan N
  </code></pre>
  
  <p>I want to compare the values in the <code>initials</code> columns found in (<code>df</code> and <code>df2</code>) and copy the name (in <code>df2</code>) which its initial is matching to the initial in the first dataframe (<code>df</code>)</p>
  
  <pre><code>import pandas as pd
  
  for i in df.initials:
      for j in df2.initials:
          if i == j:
          # copy the name value of this particular initial to df
  </code></pre>
  
  <p>The output should be like this:</p>
  
  <pre><code>     id name
   0   100 Johon
   1   200 Smith
   2   300   
  </code></pre>
  
  <p>Any idea how to solve this problem?</p>