@@ -64,15 +64,24 @@ 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.
67+ .. _whatsnew_0200.enhancements.compressed_urls:
7168
72- .. ipython:: python
69+ Better support for compressed URLs in ``read_csv``
70+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
71+
72+ Compression code was refactored (:issue:`12688`). As a result, reading
73+ dataframes from URLs in :func:`read_csv` or :func:`read_table` now supports
74+ additional compression methods: ``xz``, ``bz2``, and ``zip`` (:issue:`14570`).
75+ Previously, only ``gzip`` compression was supported. By default, compression of
76+ URLs and paths are now both inferred using their file extensions. Additionally,
77+ bz2 support for the python 2 c-engine improved (:issue:`14874`).
7378
74- url = ('https://github.com/pandas-dev/pandas/raw/master/' +
75- 'pandas/io/tests/parser/data/salaries.csv.bz2')
79+ .. ipython:: python
80+ url = 'https://github.com/{repo}/raw/{branch}/{path}'.format(
81+ repo = 'pandas-dev/pandas',
82+ branch = 'master',
83+ path = 'pandas/io/tests/parser/data/salaries.csv.bz2',
84+ )
7685 df = pd.read_table(url, compression='infer') # default, infer compression
7786 df = pd.read_table(url, compression='bz2') # explicitly specify compression
7887 df.head(2)
0 commit comments