diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 16332738ce610..869f33c213422 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1750,9 +1750,9 @@ def to_csv(self, path_or_buf=None, sep=",", na_rep='', float_format=None, encoding : string, optional A string representing the encoding to use in the output file, defaults to 'ascii' on Python 2 and 'utf-8' on Python 3. - compression : {'infer', 'gzip', 'bz2', 'xz', None}, default None + compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default None If 'infer' and `path_or_buf` is path-like, then detect compression - from the following extensions: '.gz', '.bz2' or '.xz' + from the following extensions: '.gz', '.bz2', '.zip' or '.xz' (otherwise no compression). line_terminator : string, default ``'\n'`` The newline character or character sequence to use in the output diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 16105014bf74e..cbe8d15065881 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -1999,7 +1999,7 @@ def to_json(self, path_or_buf=None, orient=None, date_format=None, .. versionadded:: 0.19.0 - compression : {'infer', 'gzip', 'bz2', 'xz', None}, default None + compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default None A string representing the compression to use in the output file, only used when the first argument is a filename.