@@ -681,14 +681,14 @@ class ExcelWriter(metaclass=abc.ABCMeta):
681
681
be parsed by ``fsspec``, e.g., starting "s3://", "gcs://".
682
682
683
683
.. versionadded:: 1.2.0
684
- if_sheet_exists : {'error', 'new', 'replace', 'write_to '}, default 'error'
684
+ if_sheet_exists : {'error', 'new', 'replace', 'overwrite_cells '}, default 'error'
685
685
How to behave when trying to write to a sheet that already
686
686
exists (append mode only).
687
687
688
688
* error: raise a ValueError.
689
689
* new: Create a new sheet, with a name determined by the engine.
690
690
* replace: Delete the contents of the sheet before writing to it.
691
- * write_to : Write contents to the existing sheet.
691
+ * overwrite_cells : Write contents to the existing sheet.
692
692
693
693
.. versionadded:: 1.3.0
694
694
engine_kwargs : dict, optional
@@ -768,16 +768,16 @@ class ExcelWriter(metaclass=abc.ABCMeta):
768
768
>>> df.to_excel(writer, sheet_name="Sheet1")
769
769
770
770
You can also write multiple DataFrames to a single sheet. Note that the
771
- `if_sheet_exists` parameter needs to be set to `write_to ` if you are in
771
+ `if_sheet_exists` parameter needs to be set to `overwrite_cells ` if you are in
772
772
append mode:
773
773
774
774
>>> with ExcelWriter("path_to_file.xlsx",
775
775
... mode="a",
776
776
... engine="openpyxl",
777
- ... if_sheet_exists="write_to ",
777
+ ... if_sheet_exists="overwrite_cells ",
778
778
... ) as writer:
779
- >>> df .to_excel(writer, sheet_name="Sheet1")
780
- >>> df .to_excel(writer, sheet_name="Sheet1", startcol=3)
779
+ >>> df1 .to_excel(writer, sheet_name="Sheet1")
780
+ >>> df2 .to_excel(writer, sheet_name="Sheet1", startcol=3)
781
781
782
782
You can store Excel file in RAM:
783
783
@@ -964,10 +964,10 @@ def __init__(
964
964
965
965
self .mode = mode
966
966
967
- if if_sheet_exists not in [None , "error" , "new" , "replace" , "write_to " ]:
967
+ if if_sheet_exists not in [None , "error" , "new" , "replace" , "overwrite_cells " ]:
968
968
raise ValueError (
969
969
f"'{ if_sheet_exists } ' is not valid for if_sheet_exists. "
970
- "Valid options are 'error', 'new', 'replace' and 'write_to '."
970
+ "Valid options are 'error', 'new', 'replace' and 'overwrite_cells '."
971
971
)
972
972
if if_sheet_exists and "r+" not in mode :
973
973
raise ValueError ("if_sheet_exists is only valid in append mode (mode='a')" )
0 commit comments