【发布时间】:2021-04-28 07:20:02
【问题描述】:
在情感分析后,我过滤了 5 条最大极性的推文。
maxx = df.nlargest(5,['polarity']).astype(str)
maxx
输出:
Unnamed: 0 clean_tweet Tweet_tokenized polarity subjectivity Sentiment_Type scores compound sentiment_type pca
315 315 Best of। luck Biden???? best / luck biden 1.0 0.3 POSITIVE {'neg': 0.0, 'neu': 0.122, 'pos': 0.878, 'comp... 0.802 POSITIVE [-0.06151099614792966, -0.030998756958434074]
现在我想创建一些 wordcloud 但我遇到了错误:
hero.wordcloud(maxx, max_words=100)
AttributeError: 'DataFrame' object has no attribute 'str'
【问题讨论】:
-
你用什么包来绘制 wordcloud
-
texthero 我正在尝试
标签: python pandas string dataframe nlp