Skip to content

Commit 734053a

Browse files
committed
DOC: Improve what's new
Reference corresponding issues in What's New. Change code example to use string formating for improved modularity.
1 parent f8a7900 commit 734053a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

doc/source/whatsnew/v0.20.0.txt

+15-3
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,22 @@ supports additional compression methods (`xz`, `bz2`, `zip`). Previously, only
6969
`gzip` compression was supported. By default, compression of URLs and paths are
7070
now both inferred using their file extensions.
7171

72-
.. ipython:: python
72+
Better support for compressed URLs in ``read_csv``
73+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
74+
75+
Compression code was refactored (:issue:`12688`). As a result, reading
76+
dataframes from URLs in :func:`read_csv` or :func:`read_table` now supports
77+
additional compression methods: ``xz``, ``bz2``, and ``zip`` (:issue:`14570`).
78+
Previously, only ``gzip`` compression was supported. By default, compression of
79+
URLs and paths are now both inferred using their file extensions. Additionally,
80+
bz2 support for the python 2 c-engine improved (:issue:`14874`).
7381

74-
url = ('https://github.com/pandas-dev/pandas/raw/master/' +
75-
'pandas/io/tests/parser/data/salaries.csv.bz2')
82+
.. ipython:: python
83+
url = 'https://github.com/{repo}/raw/{branch}/{path}'.format(
84+
repo = 'pandas-dev/pandas',
85+
branch = 'master',
86+
path = 'pandas/io/tests/parser/data/salaries.csv.bz2',
87+
)
7688
df = pd.read_table(url, compression='infer') # default, infer compression
7789
df = pd.read_table(url, compression='bz2') # explicitly specify compression
7890
df.head(2)

0 commit comments

Comments
 (0)