Pandas compare each row with all rows in data frame and save results in list for each row
I try compare each row with all rows in pandas DF through fuzzywuzzy.fuzzy.partial_ratio() >= 85 and write results in list for each row. in: df = pd.DataFrame( {'id':[1, 2, 3, 4, 5, 6], 'name':['dog', 'cat', 'mad cat', 'good dog', 'bad dog', 'chicken']}) use pandas function with fuzzywuzzy library get result: out: id name match_id_list 1 dog [4, 5] 2 cat [3, ] 3 mad cat [2, ] 4 good dog [1, 5] 5 bad dog [1, 4] 6 chicken [] But I don't understand how get this. The first step would be to find the indices that match the condition for a given name . Since partial_ratio only takes strings, we apply