Compare 2 dataframe columns and add a new column in one dataframe as "Yes" or "No" if the cell data matches : <p>I have 2 data frames as below:</p>

<pre><code>df1(main data)
UID    SG
1      A
2      B
3      C
4      D
5      E

df2
UID    AN    SG
1      x      A
3      y      C
2      z      B
1      xy     A
3      v      C
</code></pre>

<p>Now, I want to add a new column to df1, say "isPresent". This column will have "Yes" if the UID from df1 is present in df2 and "No" if UID in not in df2. So my df1 will finally looks like this,</p>

<pre><code>df1
UID    SG    isPresent
1      A      Yes
2      B      Yes
3      C      Yes
4      D      No
5      E      No
</code></pre>

<p>My approach is taking an intersection of the UIDs from both the dataframes and then a for loop in df1 to add data cell by cell.</p>

<p>But I want to apply an approach without using for loop and using pandas as much as possible, if possible.</p>
