我有一个熊猫数据框:
data = [['The scale of data becoming available', 1990], ['for instance consider the authoritative ', 1995], ['The articles in Gilbert begin with agent', 1994]]
df = pd.DataFrame(data, columns = ['Citations', 'Years'])
我想阻止列引用。
from nltk.stem import PorterStemmer
ps = PorterStemmer()
def stem_title(data):
return ps.stem(data['Citations'])
df['stem'] = df.apply(stem_title,axis=1)
但是它不起作用,它没有给我发芽,给我一列等于
df['Citations']
谢谢