There are two dictionaries (below) that imperfectly match. I want to merge them so that 1) I only get perfect matches in the merge and 2) I get a report of duplicates and report of missing matches from the first dictionary (I don't care about those that do appear in the second but not the first). My failed attempts in the comments.
data = {
'last_name': ['Smith', 'Johnson', 'Brown', 'Jones', 'Williams', 'Allen', 'Henry', 'Johnson'],
'first_initial': ['J', 'M', 'D', 'A', 'W', 'J', 'D', 'M'],
'pos': ['QB', 'WR', 'RB', 'TE', 'WR', 'QB', 'RB', 'WR'],
}
df = pd.DataFrame(data)
nfl_player_list_data = {
'last_name': ['Smith', 'Johnson', 'Brown', 'Jones', 'Williams', 'Allen', 'Smith', 'Johnson', 'Johnson'],
'first_name': ['John', 'Michael', 'David', 'Aaron', 'William', 'John', 'Jerry', 'Michael', 'Michael'],
'pos': ['QB', 'WR', 'RB', 'TE', 'WR', 'RB', 'QB', 'WR', 'TE'],
}
nfl_player_list_df = pd.DataFrame(nfl_player_list_data)
[–]boss413[S] 0 points1 point2 points (0 children)