File tree 1 file changed +16
-1
lines changed
1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -551,7 +551,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
551
551
552
552
Parameters
553
553
----------
554
- path : str
554
+ path : str or typing.BinaryIO
555
555
Path to xls or xlsx or ods file.
556
556
engine : str (optional)
557
557
Engine to use for writing. If None, defaults to
@@ -606,6 +606,21 @@ class ExcelWriter(metaclass=abc.ABCMeta):
606
606
607
607
>>> with ExcelWriter('path_to_file.xlsx', mode='a') as writer:
608
608
... df.to_excel(writer, sheet_name='Sheet3')
609
+
610
+ You can store Excel file in RAM:
611
+
612
+ >>> import io
613
+ >>> buffer = io.BytesIO()
614
+ >>> with pd.ExcelWriter(buffer) as writer:
615
+ ... df.to_excel(writer)
616
+
617
+ You can pack Excel file into zip archive:
618
+
619
+ >>> import zipfile
620
+ >>> with zipfile.ZipFile('path_to_file.zip', 'w') as zf:
621
+ ... with zf.open('filename.xlsx', 'w') as buffer:
622
+ ... with pd.ExcelWriter(buffer) as writer:
623
+ ... df.to_excel(writer)
609
624
"""
610
625
611
626
# Defining an ExcelWriter implementation (see abstract methods for more...)
You can’t perform that action at this time.
0 commit comments