Skip to content

Commit 28b9a83

Browse files
committed
Documentation updates
1 parent b4e280f commit 28b9a83

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

doc/source/whatsnew/v0.21.0.txt

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ Other Enhancements
126126
- :func:`date_range` now accepts 'Y' in addition to 'A' as an alias for end of year (:issue:`9313`)
127127
- Integration with `Apache Parquet <https://parquet.apache.org/>`__, including a new top-level :func:`read_parquet` and :func:`DataFrame.to_parquet` method, see :ref:`here <io.parquet>`.
128128
- :func:`DataFrame.add_prefix` and :func:`DataFrame.add_suffix` now accept strings containing the '%' character. (:issue:`17151`)
129+
- :func:`read_csv` can now infer compression from non-string paths, such as a ``pathlab.Path`` (:issue:`17206`).
129130

130131
.. _whatsnew_0210.api_breaking:
131132

pandas/io/parsers.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,11 @@
208208
<http://pandas.pydata.org/pandas-docs/stable/io.html#io-chunking>`_
209209
for more information on ``iterator`` and ``chunksize``.
210210
compression : {'infer', 'gzip', 'bz2', 'zip', 'xz', None}, default 'infer'
211-
For on-the-fly decompression of on-disk data. If 'infer', then use gzip,
212-
bz2, zip or xz if filepath_or_buffer is a string ending in '.gz', '.bz2',
213-
'.zip', or 'xz', respectively, and no decompression otherwise. If using
214-
'zip', the ZIP file must contain only one data file to be read in.
215-
Set to None for no decompression.
211+
For on-the-fly decompression of on-disk data. If 'infer' and
212+
`filepath_or_buffer` is path-like, then detect compression from the
213+
following extensions: '.gz', '.bz2', '.zip', or '.xz' (otherwise no
214+
decompression). If using 'zip', the ZIP file must contain only one data
215+
file to be read in. Set to None for no decompression.
216216
217217
.. versionadded:: 0.18.1 support for 'zip' and 'xz' compression.
218218

pandas/io/pickle.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ def read_pickle(path, compression='infer'):
6262
File path
6363
compression : {'infer', 'gzip', 'bz2', 'xz', 'zip', None}, default 'infer'
6464
For on-the-fly decompression of on-disk data. If 'infer', then use
65-
gzip, bz2, xz or zip if path is a string ending in '.gz', '.bz2', 'xz',
66-
or 'zip' respectively, and no decompression otherwise.
65+
gzip, bz2, xz or zip if path ends in '.gz', '.bz2', '.xz',
66+
or '.zip' respectively, and no decompression otherwise.
6767
Set to None for no decompression.
6868
6969
.. versionadded:: 0.20.0

0 commit comments

Comments
 (0)