Skip to content

Commit b3e25a0

Browse files
committed
Merge pull request #5666 from neirbowj/numpy_regression
BUG: Work-around a numpy regression affecting pandas.eval() with numexpr
2 parents 91cad62 + ba3fbb8 commit b3e25a0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

doc/source/release.rst

+1
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ Bug Fixes
820820
- Bug fix in apply when using custom function and objects are not mutated (:issue:`5545`)
821821
- Bug in selecting from a non-unique index with ``loc`` (:issue:`5553`)
822822
- Bug in groupby returning non-consistent types when user function returns a ``None``, (:issue:`5592`)
823+
- Work around regression in numpy 1.7.0 which erroneously raises IndexError from ``ndarray.item`` (:issue:`5666`)
823824

824825
pandas 0.12.0
825826
-------------

pandas/computation/align.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ def _reconstruct_object(typ, obj, axes, dtype):
251251

252252
try:
253253
ret = ret_value.item()
254-
except ValueError:
254+
except (ValueError, IndexError):
255+
# XXX: we catch IndexError to absorb a
256+
# regression in numpy 1.7.0
257+
# fixed by numpy/numpy@04b89c63
255258
ret = ret_value
256259
return ret

0 commit comments

Comments
 (0)