【发布时间】:2019-03-11 20:41:53
【问题描述】:
我正在尝试从库fuzzywuzzy 中调用 ratio() 函数来匹配两个字符串并得到以下错误消息:
AttributeError: module 'fuzzywuzzy' has no attribute 'ratio'
版本变了吗?我试图在 fuzz 中寻找其他功能以查看它是否存在,但我无法找到它。
import fuzzywuzzy as fuzz
from fuzzywuzzy import process
import Levenshtein
fuzz.ratio('Lord of the Rings', 'The Lord of the Rings')
【问题讨论】:
-
from fuzzywuzzy import fuzz -
这只是一个错字吗?或与模块版本更改有关?如果是版本问题,也许给你正在使用的版本和新版本。
标签: python fuzzywuzzy