I use the following simple code to calculate the fuzz.ratio() value of values of two lists and get the error : TypeError: object of type 'float' has no len(). (on the line : if (fuzz.ratio(i, j) >= 85): ) The code is below:
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
import pandas as pd
mra = pd.read_excel(r"C:\Users\gpmammadova\MRA_REPORT.xlsx")
cru = pd.read_excel(r"C:\Users\gpmammadova\CRU SME pipeline.xlsx")
cust_mra = mra['CUSTOMERNAME']
cust_cru = cru['Name of Client']
s_mra = cust_mra.tolist()
s_cru = cust_cru.tolist()
matched_cru = []
for i in s_mra:
for j in s_cru:
if (fuzz.ratio(i, j) >= 85):
matched_cru.append(j)
else:
matched_cru.append('NOT FOUND')