diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 95ac522833b35..cbe270d143aee 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3635,9 +3635,14 @@ def to_csv( sequence should be given if the object uses MultiIndex. If False do not print fields for index names. Use index_label=False for easier importing in R. - mode : str, default 'w' - Python write mode. The available write modes are the same as - :py:func:`open`. + mode : {{'w', 'x', 'a'}}, default 'w' + Forwarded to either `open(mode=)` or `fsspec.open(mode=)` to control + the file opening. Typical values include: + + - 'w', truncate the file first. + - 'x', exclusive creation, failing if the file already exists. + - 'a', append to the end of file if it exists. + encoding : str, optional A string representing the encoding to use in the output file, defaults to 'utf-8'. `encoding` is not supported if `path_or_buf`