使用列表理解
test['tweet'].apply(lambda x: [item for item in x if item not in stop])
返回值:
0 [love, car]
1 [view, amazing]
2 [feel, great, morning]
3 [excited, concert]
4 [best, friend]
Python从熊猫数据框中删除停用词
使用列表理解
test['tweet'].apply(lambda x: [item for item in x if item not in stop])
返回值:
0 [love, car]
1 [view, amazing]
2 [feel, great, morning]
3 [excited, concert]
4 [best, friend]