Skip to content

DOC: to_pickle arguments for compression have a mistake (easy-fix) #35364

Closed
@ianozsvald

Description

@ianozsvald

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 gzfor 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions