Pandas Compare two columns matching text and printing full row of matching
<p>I am looking to take a hash from one df and find that hash in another df.hash column and print the full row of the matches. </p>

<p>df1:
<code>
hash
11dd7da7faa0130dac2560930e90c8b1
11dd7da7faa0130dac2560930e90c8b2
11dd7da7faa0130dac2560930e90c8b3
11dd7da7faa0130dac2560930e90c8b4
</code>
df2:
<code>
filepath          hash
C:\windows        11dd7da7faa0130dac2560930e90c8b5
C:\Temp           11dd7da7faa0130dac2560930e90c8b6
C:\foundya        11dd7da7faa0130dac2560930e90c8b1
C:\Windows\temp   11dd7da7faa0130dac2560930e90c8b2
</code></p>

<p>Expected output:
<code>
filepath          hash
C:\foundya        11dd7da7faa0130dac2560930e90c8b1
C:\Windows\temp   11dd7da7faa0130dac2560930e90c8b2
</code>
Failed Attempts:
<code>
print(df2[['hash','filepath']][~df2['hash'].isin(df1)])
print(df2[['hash','filepath']][~df1.isin(df2['hash'])])
</code></p>

<p>what about a simple merge here?</p>

<pre><code>df1.merge(df2, on ='hash', how ='inner')
</code></pre>

python pandas