From b977f55035ab6f28ef0b3b6253f0df13fd34f520 Mon Sep 17 00:00:00 2001 From: tomas-cc Date: Tue, 2 Dec 2025 17:34:04 +0200 Subject: [PATCH 1/2] Update generic.py --- pandas/core/generic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index ea133e9a83adb..9154855467d8a 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2204,8 +2204,8 @@ def to_excel( Multiple sheets may be written to by specifying unique `sheet_name`. With all data written to the file it is necessary to save the changes. - Note that creating an `ExcelWriter` object with a file name that already - exists will result in the contents of the existing file being erased. + Note that creating an `ExcelWriter` object with a file name that already exists + will overwrite the existing file because the default mode is write. Parameters ---------- From dc2fc3ed20c57c8c3cc6f16fbd79ab4699ce7d83 Mon Sep 17 00:00:00 2001 From: tomas-cc Date: Wed, 3 Dec 2025 10:39:57 +0200 Subject: [PATCH 2/2] Remove trailing whitespace --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9154855467d8a..405b989d961fc 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2204,7 +2204,7 @@ def to_excel( Multiple sheets may be written to by specifying unique `sheet_name`. With all data written to the file it is necessary to save the changes. - Note that creating an `ExcelWriter` object with a file name that already exists + Note that creating an `ExcelWriter` object with a file name that already exists will overwrite the existing file because the default mode is write. Parameters