
一直在尝试使用thefuzz来比较两个不同的列表,并得到了上面的错误,这似乎不对。除了下面的两个测试行之外,我已经注释掉了代码中的其他所有内容,但仍然出现错误。我还尝试过 fuzz.ratio、fuzz.token_sort_ratio 和 fuzz.token_set_ratio,但每次都会出错。
import thefuzz as fuzz
fuzz.partial_ratio("fuzzy was a bear", "wuzzy fuzzy was a bear")你想要
import thefuzz.fuzz as fuzz
或者
from thefuzz import fuzz
因为这是你想要的功能的地方
thefuzz 自述文件的使用部分 (https://github.com/seatgeek/thefuzz/blob/master/readme .rst)建议:
from thefuzz import fuzz from thefuzz import process
以上就是模块“thefuzz”没有属性“partial_ratio”和其他奇怪的错误的详细内容,更多请关注php中文网其它相关文章!
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号