File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -762,19 +762,21 @@ class ExcelWriter(metaclass=abc.ABCMeta):
762762 ... "path_to_file.xlsx",
763763 ... mode="a",
764764 ... engine="openpyxl",
765- ... if_sheet_exists="replace"
765+ ... if_sheet_exists="replace",
766766 ... ) as writer:
767- ... df.to_excel(writer, sheet_name="Sheet1")
767+ >>> df.to_excel(writer, sheet_name="Sheet1")
768768
769- You can specify arguments to the underlying engine. For example to not
770- calculate the result of a formula:
769+ You can also write multiple DataFrames to a single sheet. Note that the
770+ `if_sheet_exists` parameter needs to be set to `write_to` if you are in
771+ append mode:
771772
772- >>> df = pd.DataFrame(["=1+1"])
773- ... with ExcelWriter(
774- ... "path_to_file.xlsx ",
775- ... engine_kwargs={"strings_to_formulas":False}
773+ >>> with ExcelWriter("path_to_file.xlsx",
774+ ... mode="a",
775+ ... engine="openpyxl ",
776+ ... if_sheet_exists="write_to",
776777 ... ) as writer:
777- ... df.to_excel(writer)
778+ >>> df.to_excel(writer, sheet_name="Sheet1")
779+ >>> df.to_excel(writer, sheet_name="Sheet1", startcol=3)
778780
779781 You can store Excel file in RAM:
780782
You can’t perform that action at this time.
0 commit comments