0

我有一个看起来像这样的数据框:

大西洋
康蒙
吉翁

我想从每个元素中删除所有重音。

我正在做的是:

from unidecode import unidecode
unidecode.unidecode(df['words'])

结果,我收到一条错误消息,上面写着:

'function' object has no atribute 'unidecode'

谁能帮我?问候

4

1 回答 1

2

您正在导入unidecode,然后将其作为属性再次调用。尝试这个:

from unidecode import unidecode
unidecode(df['words'])

根据'Series' object hast no attribute 'encode'您在尝试此操作后遇到的错误(),我的猜测是这应该有效:

df['words'] = df['words'].apply(unidecode)
于 2021-05-12T17:40:19.120 回答