I would like to know how to iterate through df.column3 find match in df.column2 and add name of df.column1 based on matches to a new column df.column4
<p>Test data looks like:
<code>
Column1 Column2 Column3
johnny  100     900
matty   300     100
grapy   400     300
snapp   500     300
</code></p>

<p>Expected Result:</p>

<p><code>
Column1 Column2 Column3 Column4
johnny  100     900     None
matty   300     100     johnny
grapy   400     300     matty
snapp   500     300     matty
</code></p>

<p>Attempted to run """df['Column1'][df['Column2'].isin(df['Column3'])"""
This partly worked but failed on some of the items that didnt match
Thanks for your help </p>

<p>If it doesn't work properly, its because you have duplicate values:    </p>

<pre><code>df['Column4'] = df.Column2.map(dict(zip(df.Column3, df.Column1)))
</code></pre>

python pandas