From 6059ef4827c5771a8a1cda805b26c63391a4e08b Mon Sep 17 00:00:00 2001 From: Warren White Date: Mon, 30 Nov 2020 20:44:19 +0000 Subject: [PATCH 1/2] DOC: Fixed to_pickle compression argument list 'gzip' > 'gz' Removed reference to gzip and replaced with correct extention of gz. --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 181c579e63105..0deb93dcc1d84 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2795,7 +2795,7 @@ def to_pickle( ---------- path : str File path where the pickled object will be stored. - compression : {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}, \ + compression : {{'infer', 'gz', 'bz2', 'zip', 'xz', None}}, \ default 'infer' A string representing the compression to use in the output file. By default, infers from the file extension in specified path. From d036e73b527bee5fc3f023d5d2cd5c437ab73824 Mon Sep 17 00:00:00 2001 From: Warren White Date: Mon, 30 Nov 2020 22:52:22 +0000 Subject: [PATCH 2/2] DOC: Reverted changes to gzip on parameter and added further information from to_csv Added section of compression parameter from pandas.DataFrame.to_pickle compression parameter. --- pandas/core/generic.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0deb93dcc1d84..4a9e020a0fe46 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2795,10 +2795,17 @@ def to_pickle( ---------- path : str File path where the pickled object will be stored. - compression : {{'infer', 'gz', 'bz2', 'zip', 'xz', None}}, \ + compression : {{'infer', 'gzip', 'bz2', 'zip', 'xz', None}}, \ default 'infer' A string representing the compression to use in the output file. By default, infers from the file extension in specified path. + Compression mode may be any of the following possible + values: {{‘infer’, ‘gzip’, ‘bz2’, ‘zip’, ‘xz’, None}}. If compression + mode is ‘infer’ and path_or_buf is path-like, then detect + compression mode from the following extensions: + ‘.gz’, ‘.bz2’, ‘.zip’ or ‘.xz’. (otherwise no compression). + If dict given and mode is ‘zip’ or inferred as ‘zip’, other entries + passed as additional compression options. protocol : int Int which indicates which protocol should be used by the pickler, default HIGHEST_PROTOCOL (see [1]_ paragraph 12.1.2). The possible