为了账号安全,请及时绑定邮箱和手机立即绑定

将对象列出到单个 CSV 中

将对象列出到单个 CSV 中

饮歌长啸 2021-06-07 17:02:02
我有一个数据框列表,我希望将其转换为多个 csv。例子:List_Df = [df1,df2,df3,df4]for i in List_Df:    i.to_csv("C:\\Users\\Public\\Downloads\\"+i+".csv")预期输出:有 4 个 csv 文件,名称为 df1.csv,df2.csv ...但我面临两个问题:第一个问题: AttributeError: 'list' object has no attribute 'to_csv'第二个问题:("C:\\Users\\Public\\Downloads\\"+ **i** +".csv") <- **i** returns the object    as it's suppose to but I wish for python to automatically take the    object_name and use it with .csv任何帮助将不胜感激,因为我是 Python 和 SOF 的新手。
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 114 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号