Apr-04-2024, 03:11 PM
Hi, I am a python novice. I am trying to use FuzzyWuzzy to compare the text in 2 columns. I have imported my csv with just the 2 columns I want to compare. I have written this code and it runs:-
def compute_fuzz_ratio():
return fuzz.ratio(['Column1Heading'], ['Column2Heading'])
however when I add df['FuzzRatio'] = df.apply(compute_fuzz_ratio, axis=1) to try and get the ratio displayed in the dataframe I get this error "TypeError: object of type 'float' has no len()" can anyone let me know what I am doing wrong?
Many thanks
def compute_fuzz_ratio():
return fuzz.ratio(['Column1Heading'], ['Column2Heading'])
however when I add df['FuzzRatio'] = df.apply(compute_fuzz_ratio, axis=1) to try and get the ratio displayed in the dataframe I get this error "TypeError: object of type 'float' has no len()" can anyone let me know what I am doing wrong?
Many thanks