Skip to content

Commit 87cfaa1

Browse files
committed
Merge tag 'v0.20.3' into releases
Version 0.20.3 * tag 'v0.20.3': (34 commits) RLS: v0.20.3 TST/PKG: Move test HDF5 file to legacy (pandas-dev#16856) DOC: Final release notes CI: Pin to sphinx 1.5 for doc build DOC: Whatsnew updates (pandas-dev#16853) BUG: kind parameter on categorical argsort (pandas-dev#16834) BUG: allow empty multiindex (fixes .isin regression, GH16777) (pandas-dev#16782) BUG: fix missing sort keyword for PeriodIndex.join (pandas-dev#16586) DOC: Pin numpy at 1.11 for doc build MAINT: Remove fspath from 0.20.x branch BUG: TimedeltaIndex raising ValueError when slice indexing (pandas-dev#16637) (pandas-dev#16638) BUG: render dataframe as html do not produce duplicate element id's (pandas-dev#16780) (pandas-dev#16801) use network decorator on additional tests (pandas-dev#16824) BUG: rolling.cov with multi-index columns should presever the MI (pandas-dev#16825) BUG: Fix Series doesn't work in pd.astype(). Now treat Series as dict. (pandas-dev#16725) BUG: Fix read of py3 PeriodIndex DataFrame HDF made in py2 (pandas-dev#16781) (pandas-dev#16790) CI: use dist/trusty rather than os/linux (pandas-dev#16806) BUG: fix to_latex bold_rows option (pandas-dev#16708) Bug in pd.merge() when merge/join with multiple categorical columns (pandas-dev#16786) BUG: Load data from a CategoricalIndex for dtype comparison, closes #… (pandas-dev#16738) ...
2 parents 483706d + 3a7f956 commit 87cfaa1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+626
-139
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
- [ ] closes #xxxx
22
- [ ] tests added / passed
3-
- [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
3+
- [ ] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff`` (On Windows, ``git diff upstream/master -u -- "*.py" | flake8 --diff`` might work as an alternative.)
44
- [ ] whatsnew entry

.travis.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -34,57 +34,57 @@ matrix:
3434
language: generic
3535
env:
3636
- JOB="3.5_OSX" TEST_ARGS="--skip-slow --skip-network"
37-
- os: linux
37+
- dist: trusty
3838
env:
3939
- JOB="2.7_LOCALE" TEST_ARGS="--only-slow --skip-network" LOCALE_OVERRIDE="zh_CN.UTF-8"
4040
addons:
4141
apt:
4242
packages:
4343
- language-pack-zh-hans
44-
- os: linux
44+
- dist: trusty
4545
env:
4646
- JOB="2.7" TEST_ARGS="--skip-slow" LINT=true
4747
addons:
4848
apt:
4949
packages:
5050
- python-gtk2
51-
- os: linux
51+
- dist: trusty
5252
env:
5353
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network" COVERAGE=true
5454
addons:
5555
apt:
5656
packages:
5757
- xsel
58-
- os: linux
58+
- dist: trusty
5959
env:
6060
- JOB="3.6" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" CONDA_FORGE=true
6161
# In allow_failures
62-
- os: linux
62+
- dist: trusty
6363
env:
6464
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
6565
# In allow_failures
66-
- os: linux
66+
- dist: trusty
6767
env:
6868
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
6969
# In allow_failures
70-
- os: linux
70+
- dist: trusty
7171
env:
7272
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
7373
# In allow_failures
74-
- os: linux
74+
- dist: trusty
7575
env:
7676
- JOB="3.5_DOC" DOC=true
7777
allow_failures:
78-
- os: linux
78+
- dist: trusty
7979
env:
8080
- JOB="2.7_SLOW" TEST_ARGS="--only-slow --skip-network"
81-
- os: linux
81+
- dist: trusty
8282
env:
8383
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
84-
- os: linux
84+
- dist: trusty
8585
env:
8686
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
87-
- os: linux
87+
- dist: trusty
8888
env:
8989
- JOB="3.5_DOC" DOC=true
9090

ci/requirements-3.5_DOC.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
python=3.5*
22
python-dateutil
33
pytz
4-
numpy
4+
numpy==1.11
55
cython

ci/requirements-3.5_DOC.run

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ipython
22
ipykernel
33
ipywidgets
4-
sphinx
4+
sphinx=1.5*
55
nbconvert
66
nbformat
77
notebook

doc/source/contributing.rst

+6
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,12 @@ run this slightly modified command::
525525

526526
git diff master --name-only -- '*.py' | grep 'pandas/' | xargs flake8
527527

528+
Note that on Windows, ``grep``, ``xargs``, and other tools are likely
529+
unavailable. However, this has been shown to work on smaller commits in the
530+
standard Windows command line::
531+
532+
git diff master -u -- "*.py" | flake8 --diff
533+
528534
Backwards Compatibility
529535
~~~~~~~~~~~~~~~~~~~~~~~
530536

doc/source/io.rst

+10-28
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,16 @@ index column inference and discard the last column, pass ``index_col=False``:
712712
pd.read_csv(StringIO(data))
713713
pd.read_csv(StringIO(data), index_col=False)
714714
715+
If a subset of data is being parsed using the ``usecols`` option, the
716+
``index_col`` specification is based on that subset, not the original data.
717+
718+
.. ipython:: python
719+
720+
data = 'a,b,c\n4,apple,bat,\n8,orange,cow,'
721+
print(data)
722+
pd.read_csv(StringIO(data), usecols=['b', 'c'])
723+
pd.read_csv(StringIO(data), usecols=['b', 'c'], index_col=0)
724+
715725
.. _io.parse_dates:
716726

717727
Date Handling
@@ -4415,34 +4425,6 @@ Performance
44154425
`Here <http://stackoverflow.com/questions/14355151/how-to-make-pandas-hdfstore-put-operation-faster/14370190#14370190>`__
44164426
for more information and some solutions.
44174427

4418-
Experimental
4419-
''''''''''''
4420-
4421-
HDFStore supports ``Panel4D`` storage.
4422-
4423-
.. ipython:: python
4424-
:okwarning:
4425-
4426-
wp = pd.Panel(randn(2, 5, 4), items=['Item1', 'Item2'],
4427-
major_axis=pd.date_range('1/1/2000', periods=5),
4428-
minor_axis=['A', 'B', 'C', 'D'])
4429-
p4d = pd.Panel4D({ 'l1' : wp })
4430-
p4d
4431-
store.append('p4d', p4d)
4432-
store
4433-
4434-
These, by default, index the three axes ``items, major_axis,
4435-
minor_axis``. On an ``AppendableTable`` it is possible to setup with the
4436-
first append a different indexing scheme, depending on how you want to
4437-
store your data. Pass the ``axes`` keyword with a list of dimensions
4438-
(currently must by exactly 1 less than the total dimensions of the
4439-
object). This cannot be changed after table creation.
4440-
4441-
.. ipython:: python
4442-
:okwarning:
4443-
4444-
store.append('p4d2', p4d, axes=['labels', 'major_axis', 'minor_axis'])
4445-
store.select('p4d2', where='labels=l1 and items=Item1 and minor_axis=A')
44464428

44474429
.. ipython:: python
44484430
:suppress:

doc/source/release.rst

+38
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,44 @@ analysis / manipulation tool available in any language.
3737
* Binary installers on PyPI: http://pypi.python.org/pypi/pandas
3838
* Documentation: http://pandas.pydata.org
3939

40+
pandas 0.20.3
41+
-------------
42+
43+
**Release date:** July 7, 2017
44+
45+
This is a minor bug-fix release in the 0.20.x series and includes some small regression fixes
46+
and bug fixes. We recommend that all users upgrade to this version.
47+
48+
See the :ref:`v0.20.3 Whatsnew <whatsnew_0203>` overview for an extensive list
49+
of all enhancements and bugs that have been fixed in 0.20.3
50+
51+
Thanks
52+
~~~~~~
53+
54+
A total of 20 people contributed to this release. People with a "+" by their
55+
names contributed a patch for the first time.
56+
57+
* Bran Yang
58+
* Chris
59+
* Chris Kerr +
60+
* DSM
61+
* David Gwynne
62+
* Douglas Rudd
63+
* Forbidden Donut +
64+
* Jeff Reback
65+
* Joris Van den Bossche
66+
* Karel De Brabandere +
67+
* Peter Quackenbush +
68+
* Pradyumna Reddy Chinthala +
69+
* Telt +
70+
* Tom Augspurger
71+
* chris-b1
72+
* gfyoung
73+
* ian +
74+
* jdeschenes +
75+
* kjford +
76+
* ri938 +
77+
4078
pandas 0.20.2
4179
-------------
4280

doc/source/whatsnew.rst

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ What's New
1818

1919
These are new features and improvements of note in each release.
2020

21+
.. include:: whatsnew/v0.20.3.txt
22+
2123
.. include:: whatsnew/v0.20.2.txt
2224

2325
.. include:: whatsnew/v0.20.0.txt

doc/source/whatsnew/v0.20.3.txt

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
.. _whatsnew_0203:
2+
3+
v0.20.3 (July 7, 2017)
4+
-----------------------
5+
6+
This is a minor bug-fix release in the 0.20.x series and includes some small regression fixes
7+
and bug fixes. We recommend that all users upgrade to this version.
8+
9+
.. contents:: What's new in v0.20.3
10+
:local:
11+
:backlinks: none
12+
13+
.. _whatsnew_0203.bug_fixes:
14+
15+
Bug Fixes
16+
~~~~~~~~~
17+
18+
- Fixed a bug in failing to compute rolling computations of a column-MultiIndexed ``DataFrame`` (:issue:`16789`, :issue:`16825`)
19+
- Fixed a pytest marker failing downstream packages' tests suites (:issue:`16680`)
20+
21+
Conversion
22+
^^^^^^^^^^
23+
24+
- Bug in pickle compat prior to the v0.20.x series, when ``UTC`` is a timezone in a Series/DataFrame/Index (:issue:`16608`)
25+
- Bug in ``Series`` construction when passing a ``Series`` with ``dtype='category'`` (:issue:`16524`).
26+
- Bug in :meth:`DataFrame.astype` when passing a ``Series`` as the ``dtype`` kwarg. (:issue:`16717`).
27+
28+
Indexing
29+
^^^^^^^^
30+
31+
- Bug in ``Float64Index`` causing an empty array instead of ``None`` to be returned from ``.get(np.nan)`` on a Series whose index did not contain any ``NaN`` s (:issue:`8569`)
32+
- Bug in ``MultiIndex.isin`` causing an error when passing an empty iterable (:issue:`16777`)
33+
- Fixed a bug in a slicing DataFrame/Series that have a ``TimedeltaIndex`` (:issue:`16637`)
34+
35+
I/O
36+
^^^
37+
38+
- Bug in :func:`read_csv` in which files weren't opened as binary files by the C engine on Windows, causing EOF characters mid-field, which would fail (:issue:`16039`, :issue:`16559`, :issue:`16675`)
39+
- Bug in :func:`read_hdf` in which reading a ``Series`` saved to an HDF file in 'fixed' format fails when an explicit ``mode='r'`` argument is supplied (:issue:`16583`)
40+
- Bug in :meth:`DataFrame.to_latex` where ``bold_rows`` was wrongly specified to be ``True`` by default, whereas in reality row labels remained non-bold whatever parameter provided. (:issue:`16707`)
41+
- Fixed an issue with :meth:`DataFrame.style` where generated element ids were not unique (:issue:`16780`)
42+
- Fixed loading a ``DataFrame`` with a ``PeriodIndex``, from a ``format='fixed'`` HDFStore, in Python 3, that was written in Python 2 (:issue:`16781`)
43+
44+
Plotting
45+
^^^^^^^^
46+
47+
- Fixed regression that prevented RGB and RGBA tuples from being used as color arguments (:issue:`16233`)
48+
- Fixed an issue with :meth:`DataFrame.plot.scatter` that incorrectly raised a ``KeyError`` when categorical data is used for plotting (:issue:`16199`)
49+
50+
Reshaping
51+
^^^^^^^^^
52+
53+
- ``PeriodIndex`` / ``TimedeltaIndex.join`` was missing the ``sort=`` kwarg (:issue:`16541`)
54+
- Bug in joining on a ``MultiIndex`` with a ``category`` dtype for a level (:issue:`16627`).
55+
- Bug in :func:`merge` when merging/joining with multiple categorical columns (:issue:`16767`)
56+
57+
Categorical
58+
^^^^^^^^^^^
59+
60+
- Bug in ``DataFrame.sort_values`` not respecting the ``kind`` parameter with categorical data (:issue:`16793`)

pandas/_libs/src/parser/io.c

+19-17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ The full license is in the LICENSE file, distributed with this software.
1313
#include <sys/stat.h>
1414
#include <fcntl.h>
1515

16+
#ifndef O_BINARY
17+
#define O_BINARY 0
18+
#endif /* O_BINARY */
19+
1620
/*
1721
On-disk FILE, uncompressed
1822
*/
@@ -23,26 +27,25 @@ void *new_file_source(char *fname, size_t buffer_size) {
2327
return NULL;
2428
}
2529

26-
fs->fd = open(fname, O_RDONLY);
30+
fs->fd = open(fname, O_RDONLY | O_BINARY);
2731
if (fs->fd == -1) {
28-
goto err_free;
32+
free(fs);
33+
return NULL;
2934
}
3035

3136
// Only allocate this heap memory if we are not memory-mapping the file
3237
fs->buffer = (char *)malloc((buffer_size + 1) * sizeof(char));
3338

3439
if (fs->buffer == NULL) {
35-
goto err_free;
40+
close(fs->fd);
41+
free(fs);
42+
return NULL;
3643
}
3744

3845
memset(fs->buffer, '\0', buffer_size + 1);
3946
fs->size = buffer_size;
4047

4148
return (void *)fs;
42-
43-
err_free:
44-
free(fs);
45-
return NULL;
4649
}
4750

4851
void *new_rd_source(PyObject *obj) {
@@ -184,37 +187,36 @@ void *new_mmap(char *fname) {
184187
fprintf(stderr, "new_file_buffer: malloc() failed.\n");
185188
return (NULL);
186189
}
187-
mm->fd = open(fname, O_RDONLY);
190+
mm->fd = open(fname, O_RDONLY | O_BINARY);
188191
if (mm->fd == -1) {
189192
fprintf(stderr, "new_file_buffer: open(%s) failed. errno =%d\n",
190193
fname, errno);
191-
goto err_free;
194+
free(mm);
195+
return NULL;
192196
}
193197

194198
if (fstat(mm->fd, &stat) == -1) {
195199
fprintf(stderr, "new_file_buffer: fstat() failed. errno =%d\n",
196200
errno);
197-
goto err_close;
201+
close(mm->fd);
202+
free(mm);
203+
return NULL;
198204
}
199205
filesize = stat.st_size; /* XXX This might be 32 bits. */
200206

201207
mm->memmap = mmap(NULL, filesize, PROT_READ, MAP_SHARED, mm->fd, 0);
202208
if (mm->memmap == MAP_FAILED) {
203209
/* XXX Eventually remove this print statement. */
204210
fprintf(stderr, "new_file_buffer: mmap() failed.\n");
205-
goto err_close;
211+
close(mm->fd);
212+
free(mm);
213+
return NULL;
206214
}
207215

208216
mm->size = (off_t)filesize;
209217
mm->position = 0;
210218

211219
return mm;
212-
213-
err_close:
214-
close(mm->fd);
215-
err_free:
216-
free(mm);
217-
return NULL;
218220
}
219221

220222
int del_mmap(void *ptr) {

pandas/compat/numpy/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
_np_version_under1p11 = _nlv < '1.11'
1616
_np_version_under1p12 = _nlv < '1.12'
1717
_np_version_under1p13 = _nlv < '1.13'
18+
_np_version_under1p14 = _nlv < '1.14'
1819

1920
if _nlv < '1.7.0':
2021
raise ImportError('this version of pandas is incompatible with '
@@ -74,4 +75,6 @@ def np_array_datetime64_compat(arr, *args, **kwargs):
7475
'_np_version_under1p10',
7576
'_np_version_under1p11',
7677
'_np_version_under1p12',
78+
'_np_version_under1p13',
79+
'_np_version_under1p14'
7780
]

0 commit comments

Comments
 (0)