I\'m trying to fuzzy match two csv files, each containing one column of names, that are similar but not the same.
My code so far is as follows:
impor
Several pieces of your code can be greatly simplified by using process.extractOne() from FuzzyWuzzy. Not only does it just return the top match, you can set a score threshold for it within the function call, rather than needing to perform a separate logical step, e.g.:
process.extractOne(row, data, score_cutoff = 60)
This function will return a tuple of the highest match plus the accompanying score if it finds a match satisfying the condition. It will return None otherwise.