diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 5a1b2a5dcd20b..71d5068e2e0fc 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2179,6 +2179,12 @@ def _repr_data_resource_(self): ... df1.to_excel(writer, sheet_name='Sheet_name_1') ... df2.to_excel(writer, sheet_name='Sheet_name_2') + ExcelWriter can also be used to append to an existing Excel file: + + >>> with pd.ExcelWriter('output.xlsx', + ... mode='a') as writer: # doctest: +SKIP + ... df.to_excel(writer, sheet_name='Sheet_name_3') + To set the library that is used to write the Excel file, you can pass the `engine` keyword (the default engine is automatically chosen depending on the file extension):