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 @@ -541,7 +541,7 @@ class ExcelWriter(metaclass=abc.ABCMeta):
541
541
542
542
Parameters
543
543
----------
544
- path : str
544
+ path : str or BinaryIO
545
545
Path to xls or xlsx or ods file.
546
546
engine : str (optional)
547
547
Engine to use for writing. If None, defaults to
@@ -596,6 +596,21 @@ class ExcelWriter(metaclass=abc.ABCMeta):
596
596
597
597
>>> with ExcelWriter('path_to_file.xlsx', mode='a') as writer:
598
598
... df.to_excel(writer, sheet_name='Sheet3')
599
+
600
+ You can store Excel file in RAM:
601
+
602
+ >>> import io
603
+ >>> buffer = io.BytesIO()
604
+ >>> with pd.ExcelWriter(buffer) as writer:
605
+ ... df.to_excel(writer)
606
+
607
+ You can pack Excel file into zip archive:
608
+
609
+ >>> import zipfile
610
+ >>> with zipfile.ZipFile('path_to_file.zip', 'w') as zf:
611
+ ... with zf.open('filename.xlsx', 'w') as buffer:
612
+ ... with pd.ExcelWriter(buffer) as writer:
613
+ ... df.to_excel(writer)
599
614
"""
600
615
601
616
# Defining an ExcelWriter implementation (see abstract methods for more...)
You can’t perform that action at this time.
0 commit comments