python - 为什么我会收到“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'
解决方案
推荐阅读
- css - CSS 切换 bootstrap-vue 卡全屏
- c# - 在正文中发送 json 以进行 API 后期测试
- html - 使用 ActionLink 将目录的值从锚标记传递到控制器
- mysql - Mysql经常关机/重启
- python - 我可以解析 PDF 文件以进行抓取吗?
- javascript - 使用 javascript 修复正则表达式以支持 wiki 中的电子邮件示例?
- html - 在选择字段中多次选择多个选项
- amazon-web-services - 使用 java 13 的 aws lambda
- node.js - Azure函数获取订阅中的资源组列表-Nodejs
- html - 为什么是
标签占用空白而不是背景色