我有以下数据:
我正在尝试使用库 - pyjarowinkler 并找到字符串之间的距离 - 我的 hello world 代码有效
#Hello World
d1=distance.get_jaro_distance("Hello","hello", winkler=True, scaling=0.1);
d1
当我尝试迭代每一行或使用 apply 我的代码失败。有人可以指出我正确的方向。
#Import data
import pandas
df = pandas.read_csv('data.csv')
from pyjarowinkler import distance
score=df.apply(distance.get_jaro_distance(df[S1],df[Stores]))
# iterating over rows using iterrows() function
for i, j in df.iterrows():
print(i, j,distance.get_jaro_distance(i,j,winkler=True, scaling=0.1))
print()
错误:
JaroDistanceException: Cannot calculate distance from NoneType (int, Series)
预期的输出是: