for Loop over a list fuzzy match printing out match score thanks in advance

question about a fuzzy match. Here is function trying to write def fuzz(x, keys): for i in keys: a = fuzz.ratio(x, keys) return dataset[‘match’] = dataset.col1.apply(fuzz, word=[‘apple’, ‘orange’, ‘banana’]) how to for loop(or other solution) over a list and append matching scores to dataset? expected output col1 match banana 100 appl 80 oranges 90 ba… Read More for Loop over a list fuzzy match printing out match score thanks in advance

How to replace the use of two for's(), a list and a dataframe in python?

I have a dataframe and a string list: import pandas as pd from fuzzywuzzy import fuzz from fuzzywuzzy import process df = pd.DataFrame({‘Name’: [‘PARIS’, ‘NEW YORK’, ‘MADRI’, ‘PARI’, ‘P ARIS’, ‘NOW YORK’, ‘PORTUGAL’, ‘PORTUGLA’], ‘Column_two’: [1,2,3,4,5,6,7,8] }) print(df) # Output: Name Column_two PARIS 1 NEW YORK 2 MADRI 3 PARI 4 P ARIS 5 NOW… Read More How to replace the use of two for's(), a list and a dataframe in python?