python - 'DataFrame' 对象没有属性 'encode'
问题描述
# Open/create a file to append data to
csvFileuserid = open('useidmsg.csv', 'a')
#Use csv writer
csvWriter = csv.writer(csvFileuserid)
for i in uniqueid:
#print(i)
#print(type(i))
try:
a10=gp1.get_group(i)
#print(a10)
print(a10.shape)
except:
print(0)
# Write a row to the CSV file. I use encode UTF-8
csvWriter.writerow([a10.encode('utf-8')])
print (tweet.created_at, tweet.text)
csvFileuserid.close()
代码出现以下错误:
'DataFrame' object has no attribute 'encode'
解决方案
推荐阅读
- python - 解析字符串以供进一步使用
- docker - 更改卷内容后,容器无法读取 Docker 共享卷
- bash - 有没有办法让主管从文件中获取变量?
- parsing - Haskell - 用另一个解析器散布解析器
- qt - 'QScrollBar:vertical' 与 QComboBox 样式表中的其他子控件放在一起时无效
- .net - 我想在每个节点中创建一个包含 N 个字段的列表
- excel - 根据单元格引用从工作表中检索信息?
- go - 我想从 Goproxy 中删除我的私人包
- salesforce - 通过工具 api 访问 CustomFieldDefinition 元数据
- c++ - 使用布尔变量理解按位异或 (^)