How can I create an artificial key column for merging two datasets using difflab when the column of interest has missing cells?
问题 Goal : If the name in df2 in row i is a sub-string or an exact match of a name in df1 in some row N and the state and district columns of row N in df1 are a match to the respective state and district columns of df2 row i, combine. I was recommended of using difflib to create an artificial key column to merge on. This new column is called 'name'. difflib.get_close_matches looks for similar strings in df2. This works well when all rows in the 'CandidateName' column are present but I get