def stem(text):
y=[]
for i in text.split():
y.append(ps.stem(i))
return " ".join(y)
new_df['tags'].apply(stem())
error:stem() missing 1 required positional argument: 'text'
试试这个代码。。
def stem(text):
y=[]
for i in text.split():
y.append(ps.stem(i))
return " ".join(y)
new_df['tags']=new_df['tags'].apply(stem)