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

Posted GavinSimons

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Pandas存储为Excel格式:单个xlsx文件下多sheet存储方法相关的知识,希望对你有一定的参考价值。

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存储方法的主要内容,如果未能解决你的问题,请参考以下文章