I have a data frame I created from an imported CSV file in python, following a fuzzy match logic I created the below, but I'm stuck on how I can apply the logic to column in a data frame:
import pip
import pandas as pd
Str1 = "Los Angeles Lakers"
Str2 = "Lakers"
Partial_Ratio = fuzz.partial_ratio(Str1.lower(),Str2.lower())
print(Partial_Ratio)
but I want to be able to apply the same logic to 2 columns in a data frame, I tried the below but no joy.
import pip
import pandas as pd
df = pd.read_csv(r'C:\Users\lozza\Documents\Work\Python_Packages\biz.csv')
pip.main(['install','fuzzywuzzy','fuzz'])
from fuzzywuzzy import fuzz
df1 = pd.DataFrame(df)
df1['Partial_Ratio'] = (fuzz.partial_ratio(df1['item_desc'].lower(),df1['desc'].lower()))
print(df1[['item','item_desc', 'desc','Partial_Ratio']])