Skip to content

Commit 76edcde

Browse files
committed
Add an exmaples section of ExcelWriter
1 parent e040ab0 commit 76edcde

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/io/excel.py

+9
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,15 @@ class ExcelWriter(object):
826826
-----
827827
For compatibility with CSV writers, ExcelWriter serializes lists
828828
and dicts to strings before writing.
829+
830+
Examples
831+
--------
832+
In order to write separate DataFrames to separate sheets
833+
in a single Excel file, one can pass an ExcelWriter.
834+
835+
>>> with ExcelWriter('path_to_file.xlsx') as writer:
836+
... df1.to_excel(writer, sheet_name='Sheet1')
837+
... df2.to_excel(writer, sheet_name='Sheet2')
829838
"""
830839
# Defining an ExcelWriter implementation (see abstract methods for more...)
831840

0 commit comments

Comments
 (0)