首页 > 解决方案 > 为什么我会收到“AttributeError:'list' 对象没有属性'encode'”?

问题描述

我正在运行此程序,因为我正在尝试对我收集的推文进行情绪分析。

# Instantiate new SentimentIntensityAnalyzer
sid = SentimentIntensityAnalyzer()

# Generate sentiment scores
sentiment_scores = tweets['text_lemmatized'].apply(sid.polarity_scores)

但我收到此错误消息。不知道为什么。

AttributeError: 'list' object has no attribute 'encode'

标签: pythontweepysentiment-analysis

解决方案


推荐阅读