diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 9d19b02c4d1fb..19ac4b49358d4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -9512,6 +9512,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, path_or_buf : str or file handle, default None File path or object, if None is provided the result is returned as a string. + .. versionchanged:: 0.24.0 Was previously named "path" for Series. sep : str, default ',' @@ -9525,6 +9526,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, header : bool or list of str, default True Write out the column names. If a list of strings is given it is assumed to be aliases for the column names. + .. versionchanged:: 0.24.0 Previously defaulted to False for Series. index : bool, default True @@ -9546,6 +9548,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, is path-like, then detect compression from the following extensions: '.gz', '.bz2', '.zip' or '.xz'. (otherwise no compression). + .. versionchanged:: 0.24.0 'infer' option added and set to default. quoting : optional constant from csv module @@ -9563,6 +9566,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, Write MultiIndex columns as a list of tuples (if True) or in the new, expanded format, where each MultiIndex column is a row in the CSV (if False). + .. deprecated:: 0.21.0 This argument will be removed and will always write each row of the multi-index as a separate row in the CSV file. @@ -9586,7 +9590,7 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, See Also -------- pandas.read_csv : Load a CSV file into a DataFrame. - pandas.to_excel: Load an Excel file into a DataFrame. + pandas.to_excel : Load an Excel file into a DataFrame. Examples --------