Description
Location of the documentation
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_pickle.html
Documentation problem
compression{‘infer’, ‘gzip’, ‘bz2’, ‘zip’, ‘xz’, None}, default ‘infer’
notes that gzip
is a valid extension, this is wrong, the extension checked for is gz
. The documentation for to_csv
is correct with ... detect compression mode from the following extensions: ‘.gz’, ‘.bz2’, ‘.zip’ or ‘.xz’
and should act as a guide: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html
Suggested fix for documentation
compression{‘infer’, ‘gz’, ‘bz2’, ‘zip’, ‘xz’, None}, default ‘infer’
to match the code implementation: https://github.com/pandas-dev/pandas/blob/v1.0.5/pandas/io/common.py#L223
There may be an argument to extending the _compression_to_extension
code to accept both gzip
and gz
for gzip compression, whoever reads this might decide this is worth escalating. For me making sure we fix the docs in line with the code is the priority.