首页 > 其他 > 详细

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

时间:2018-06-01 00:40:49      阅读:296      评论:0      收藏:0      [点我收藏+]

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存储方法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!