I have two dataframes that contains names. What I am need to do is to check which of the names in second dataframe are not present in the first dataframe. For this example
list1 = ['Mark','Sofi','Joh','Leo','Jason']
df1 = pd.DataFrame(list1, columns =['Names'])
and
list2 = ['Mark','Sofi','David','Matt','Jason']
df2 = pd.DataFrame(list2, columns =['Names'])
So basically I in this simple example we can see that David and Matt from second dataframe do not exist in the first dataframe.
I need programmatically to come up with 3rd dataframe that will have results like this:
Names
David
Matt
My first thought was to try using pandas merge function but I am unable to get the unique set of names from df2 that are not in df1.
Any thoughts on how to do this?