Skip to content

Commit 98d5e0d

Browse files
committed
DOC: What's New for refactored compression code
Add what's new corresponding to #14576.
1 parent 4baa4c5 commit 98d5e0d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

doc/source/whatsnew/v0.20.0.txt

+13
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ fixed-width text files, and :func:`read_excel` for parsing Excel files.
4444
pd.read_fwf(StringIO(data)).dtypes
4545
pd.read_fwf(StringIO(data), dtype={'a':'float64', 'b':'object'}).dtypes
4646

47+
Reading dataframes from URLs, in :func:`read_csv` or :func:`read_table`, now
48+
supports additional compression methods (`xz`, `bz2`, `zip`). Previously, only
49+
`gzip` compression was supported. By default, compression of URLs and paths are
50+
now both inferred using their file extensions.
51+
52+
.. ipython:: python
53+
54+
url = ('https://github.com/pandas-dev/pandas/raw/master/' +
55+
'pandas/io/tests/parser/data/salaries.csv.bz2')
56+
df = pd.read_table(url, compression='infer') # default, infer compression
57+
df = pd.read_table(url, compression='bz2') # explicitly specify compression
58+
df.head(2)
59+
4760
.. _whatsnew_0200.enhancements.other:
4861

4962
Other enhancements

0 commit comments

Comments
 (0)