Python stemming (with pandas dataframe)

最后都变了- 提交于 2019-12-03 08:31:46

You have to apply the stemming on each word and store it into the "stemmed" column.

EDIT

for example :

In [23]: data
Out[23]: 
                      stemmed
0       [amsterdamse, and , yes]
1  [marathon, hello, verbazing]

Then the following should work

data['stemmed'] = data["stemmed"].apply(lambda x: [stemmer.stem(y) for y in x])

Out[25]: 
0        [amsterdam, and, yes]
1    [marathon, hello, verbaz]
Name: stemmed, dtype: object
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!