首页 > 解决方案 > 如何将输出显示为仅包含单词而不包含计数的列表?

问题描述

from nltk.corpus import stopwords
stopwords_list = stopwords.words('english')
token = [token for token in token if token not in stopwords_list]
token


freq6000 = []
Wrd_Freq = nltk.FreqDist(token)
Wrd_Freq

df_WrdFreq = pd.DataFrame.from_dict(Wrd_Freq, orient='Index') 
df_WrdFreq.columns=['Word Frequency']     


freq6000= df_WrdFreq[(df_WrdFreq('Word Frequency') >= 6000)]

TypeError Traceback (last last call last) in 13 14 ---> 15 freq6000= df_WrdFreq[(df_WrdFreq('Word Frequency') >= 6000)]

TypeError:“DataFrame”对象不可调用

标签: python-3.xpandas

解决方案


推荐阅读