Skip to content

Commit fb282b6

Browse files
authored
DOC update DataFrame.to_csv write modes (#51839) (#51881)
* DOC update DataFrame.to_csv write modes (#51839) * DOC: style fix (#51839) * DOC update DataFrame.to_csv write modes (#51839) Modify write mode descriptions and add an explanation for b and t mode. * DOC: update DataFrame.to_csv write modes (#51839) Put path_or_buf in backticks. * DOC: update DataFrame.to_csv write modes (#51839) Remove the 'b' and 't' modes from the description. * DOC: update DataFrame.to_csv write modes (#51839) Modify 'w', 'a', and 'x' write mode's description.
1 parent 9289f5d commit fb282b6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

pandas/core/generic.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -3650,9 +3650,14 @@ def to_csv(
36503650
sequence should be given if the object uses MultiIndex. If
36513651
False do not print fields for index names. Use index_label=False
36523652
for easier importing in R.
3653-
mode : str, default 'w'
3654-
Python write mode. The available write modes are the same as
3655-
:py:func:`open`.
3653+
mode : {{'w', 'x', 'a'}}, default 'w'
3654+
Forwarded to either `open(mode=)` or `fsspec.open(mode=)` to control
3655+
the file opening. Typical values include:
3656+
3657+
- 'w', truncate the file first.
3658+
- 'x', exclusive creation, failing if the file already exists.
3659+
- 'a', append to the end of file if it exists.
3660+
36563661
encoding : str, optional
36573662
A string representing the encoding to use in the output file,
36583663
defaults to 'utf-8'. `encoding` is not supported if `path_or_buf`

0 commit comments

Comments
 (0)