码迷,mamicode.com
首页 > 其他好文 > 详细

Pandas存储为Excel格式:单个xlsx文件下多sheet存储方法

时间:2018-06-01 00:59:16      阅读:466      评论:0      收藏:0      [点我收藏+]

标签:string   ati   excel格式   The   passing   list   one   org   and   

Notes

If passing an existing ExcelWriter object, then the sheet will be added to the existing workbook. This can be used to save different DataFrames to one workbook:

>>> writer = pd.ExcelWriter(‘output.xlsx‘)
>>> df1.to_excel(writer,‘Sheet1‘)
>>> df2.to_excel(writer,‘Sheet2‘)
>>> writer.save()

For compatibility with to_csv, to_excel serializes lists and dicts to strings before writing.

 

摘自  http://pandas.pydata.org/pandas-docs/stable/generated/pandas.DataFrame.to_excel.html#pandas.DataFrame.to_excel

Pandas存储为Excel格式:单个xlsx文件下多sheet存储方法

标签:string   ati   excel格式   The   passing   list   one   org   and   

原文地址:https://www.cnblogs.com/GavinSimons/p/9119820.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!