title: Pandas: compare two columns and return matched rows
body: <p>I have two dataframes with multiple columns. </p>
  
  <p>I would like to compare df1['postcode'] and df2['pcd'] and build a new df based on the matched values of these two columns. </p>
  
  <p>Note- the length of the two columns I want to match is not the same. </p>
  
  <pre><code>df1
    postcode brand
  1 znuee    soony 
  2 eusjk    nike
  3 zieum    addidas
  4 psosk    ferrari
  
  df2
    pcd      brand
  1 dodkm    soony 
  2 eusjk    nike
  3 sjksj    addidas
  4 psosk    ferrari
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>newdf
    pcd      brand
  1 eusjk    nike
  2 psosk    ferrari
  </code></pre>
  
  <p>my attempt but i get a mismatch length on the columns</p>
  
  <pre><code>newdf = (df2['postcode'] == df1).all(axis=1).astype(int)
  </code></pre>
  
  <p>Do i need to use some kind of loopup function?</p>