Skip to content

Commit e6b2c09

Browse files
committed
to_csv
1 parent 693eead commit e6b2c09

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

pandas/core/generic.py

+19-8
Original file line numberDiff line numberDiff line change
@@ -9513,8 +9513,11 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
95139513
path_or_buf : string or file handle, default None
95149514
File path or object, if None is provided the result is returned as
95159515
a string.
9516+
95169517
.. versionchanged:: 0.24.0
9517-
Was previously named "path" for Series.
9518+
9519+
Was previously named "path" for Series.
9520+
95189521
sep : character, default ','
95199522
Field delimiter for the output file.
95209523
na_rep : string, default ''
@@ -9526,8 +9529,11 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
95269529
header : boolean or list of string, default True
95279530
Write out the column names. If a list of strings is given it is
95289531
assumed to be aliases for the column names
9532+
95299533
.. versionchanged:: 0.24.0
9530-
Previously defaulted to False for Series.
9534+
9535+
Previously defaulted to False for Series.
9536+
95319537
index : boolean, default True
95329538
Write row names (index)
95339539
index_label : string or sequence, or False, default None
@@ -9541,14 +9547,16 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
95419547
encoding : string, optional
95429548
A string representing the encoding to use in the output file,
95439549
defaults to 'ascii' on Python 2 and 'utf-8' on Python 3.
9544-
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None},
9545-
default 'infer'
9546-
If 'infer' and `path_or_buf` is path-like, then detect compression
9547-
from the following extensions: '.gz', '.bz2', '.zip' or '.xz'
9548-
(otherwise no compression).
9550+
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}
9551+
9552+
If 'infer' (the defualt) and `path_or_buf` is path-like, then
9553+
detect compression from the following extensions: '.gz', '.bz2',
9554+
'.zip' or '.xz' (otherwise no compression).
95499555
95509556
.. versionchanged:: 0.24.0
9557+
95519558
'infer' option added and set to default
9559+
95529560
line_terminator : string, default ``'\n'``
95539561
The newline character or character sequence to use in the output
95549562
file
@@ -9565,7 +9573,9 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
95659573
chunksize : int or None
95669574
rows to write at a time
95679575
tupleize_cols : boolean, default False
9576+
95689577
.. deprecated:: 0.21.0
9578+
95699579
This argument will be removed and will always write each row
95709580
of the multi-index as a separate row in the CSV file.
95719581
@@ -9579,7 +9589,8 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None,
95799589
European data
95809590
95819591
.. versionchanged:: 0.24.0
9582-
The order of arguments for Series was changed.
9592+
9593+
The order of arguments for Series was changed.
95839594
"""
95849595

95859596
df = self if isinstance(self, ABCDataFrame) else self.to_frame()

0 commit comments

Comments
 (0)