I have two dataframes with 2 similar columns "date" and "id_number" and I want to find all the id_number missing from the second table to compare.
Here's my code:
import pandas as pd
data1 = {'date': ['7/09/22', '7/09/22', '7/09/22'],
'second_column': ['first_value', 'second_value', 'third_value'],
'id_number':['AA576bdk89', 'GG6jabkhd589', 'BXV6jabd589'],
'fourth_column':['first_value', 'second_value', 'third_value'],
}
data2 = {'date': ['7/09/22', '7/09/22', '7/09/22', '7/09/22', '7/09/22', '7/09/22'],
'second_column': ['first_value', 'second_value', 'third_value','fourth_value', 'fifth_value','sixth_value'],
'id_number':['AA576bdk89', 'GG6jabkhd589', 'BXV6jabd589','BXV6mkjdd589','GGdbkz589', 'BXhshhsd589'],
'fourth_column':['first_value', 'second_value', 'third_value','fourth_value', 'fifth_value','sixth_value'],
}
df1 = pd.DataFrame(data1)
df2 = pd.DataFrame(data2)
print (df1)
print ('\n')
print (df2)
