diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 8658715b8bf3e..4bf6a3e97f0c6 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -86,7 +86,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Timestamp.ceil \ pandas.Timestamp.floor \ pandas.Timestamp.round \ - pandas.ExcelWriter \ pandas.read_json \ pandas.io.json.build_table_schema \ pandas.io.formats.style.Styler.to_latex \ diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 786f719337b84..2189f54263dec 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -935,7 +935,7 @@ class ExcelWriter(Generic[_WorkbookT]): is installed otherwise `openpyxl `__ * `odswriter `__ for ods files - See ``DataFrame.to_excel`` for typical usage. + See :meth:`DataFrame.to_excel` for typical usage. The writer should be used as a context manager. Otherwise, call `close()` to save and close any opened file handles. @@ -1031,7 +1031,7 @@ class ExcelWriter(Generic[_WorkbookT]): Here, the `if_sheet_exists` parameter can be set to replace a sheet if it already exists: - >>> with ExcelWriter( + >>> with pd.ExcelWriter( ... "path_to_file.xlsx", ... mode="a", ... engine="openpyxl", @@ -1042,7 +1042,8 @@ class ExcelWriter(Generic[_WorkbookT]): You can also write multiple DataFrames to a single sheet. Note that the ``if_sheet_exists`` parameter needs to be set to ``overlay``: - >>> with ExcelWriter("path_to_file.xlsx", + >>> with pd.ExcelWriter( + ... "path_to_file.xlsx", ... mode="a", ... engine="openpyxl", ... if_sheet_exists="overlay",