在情感分析之后,我过滤了最大的 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'