Skip to content
Advertisement

Check if value from one dataframe exists in another dataframe and create column

I am looking to compare values of columns in two different datasets and create a column with the results that have matched.

DF1:

JavaScript

DF2 =

JavaScript

Expected Result

DF1:

JavaScript

I can see the matches using the following code:

JavaScript

And i can return a 1/0 with the following:

JavaScript

However, i cannot seem to merge them both

Advertisement

Answer

JavaScript

Output:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement