Fuzzywuzzy调用python中的错误

时间:2018-05-21 10:29:46

标签: python fuzzywuzzy

我有一个数据框:

alertname   custname
0   wlison  wilson
1   dais    said
2   4dams   adams
3   ad4ms   adams
4   ad48s   adams
5   smyth   smith
6   smythe  smith
7   gillan  gillan
8   gilen   gillan
9   scott-smith scottsmith
10  scott smith scottsmith
11  perrson person
12  persson person

现在,当我从fuzzywuzzy包中运行follwing命令时:

from fuzzywuzzy import process
from fuzzywuzzy import fuzz
import Levenshtein

key=['wilson']


process.extractone(key, choices=alertname,scorer=fuzz.token_sort_ratio,limit=10)

它给了我以下错误:

AttributeError:'module'对象没有属性'extractone'

1 个答案:

答案 0 :(得分:1)

它的

process.extractOne(key, choices=alertname,scorer=fuzz.token_sort_ratio,limit=10)

你错过了捕获O