Skip to content

Commit 210fb20

Browse files
committed
DOC: What's New for refactored compression code
Add what's new corresponding to #14576.
1 parent cb91007 commit 210fb20

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

doc/source/whatsnew/v0.20.0.txt

+12
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ Strings passed to ``DataFrame.groupby()`` as the ``by`` parameter may now refere
6464

6565
df.groupby(['second', 'A']).sum()
6666

67+
Reading dataframes from URLs, in :func:`read_csv` or :func:`read_table`, now
68+
supports additional compression methods (`xz`, `bz2`, `zip`). Previously, only
69+
`gzip` compression was supported. By default, compression of URLs and paths are
70+
now both inferred using their file extensions.
71+
72+
.. ipython:: python
73+
74+
url = ('https://github.com/pandas-dev/pandas/raw/master/' +
75+
'pandas/io/tests/parser/data/salaries.csv.bz2')
76+
df = pd.read_table(url, compression='infer') # default, infer compression
77+
df = pd.read_table(url, compression='bz2') # explicitly specify compression
78+
df.head(2)
6779

6880
.. _whatsnew_0200.enhancements.other:
6981

0 commit comments

Comments
 (0)