I have two datasets that I need to see how many names are different in one dataset to another. I used this question for reference and the code I used only found 1 issue is there are others.
Check if value from one dataframe exists in another dataframe
DF1
Name: 'Adam', 'Ben', 'Chris', 'Dave', 'Emily'
DF2
Manager: 'Adam', 'Beth', 'Jack', 'Grace', 'Mel', 'Emily', 'Chris'
I am trying to find a method that will create a new column indicating when names match or not.
Desired Output:
Adam 1
Ben 0
Chris 1
Dave 0
Emily 1
This is the code used.
df3 = df2.assighn(indf1=df2.Manager.isin(df1.Name).astype(int))
Any suggestions?
DF1
name id position_num job_title
Lawrence 00010293 62121 Analytic Supervisor
Richard 00023723 73213 Lead Data Manger
Elizabeth 00024422 42392 Analytic Director
Nicole 00012123 23423 Data Management Manger
Timothy 00032112 32134 Business Execution Manager