Skip to content

Commit e5285e3

Browse files
committed
np.AxisError was added in numpy 1.13
1 parent f9c4169 commit e5285e3

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
'Topic :: Scientific/Engineering',
2626
]
2727

28-
INSTALL_REQUIRES = ['numpy >= 1.12', 'pandas >= 0.19.2']
28+
INSTALL_REQUIRES = ['numpy >= 1.13', 'pandas >= 0.19.2']
2929
TESTS_REQUIRE = ['pytest >= 2.7.1']
3030
if sys.version_info[0] < 3:
3131
TESTS_REQUIRE.append('mock')

xarray/core/dask_array_compat.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,13 @@ def isin(element, test_elements, assume_unique=False, invert=False):
4444
import math
4545
from numbers import Integral, Real
4646

47-
AxisError = np.AxisError
47+
try:
48+
AxisError = np.AxisError
49+
except AttributeError:
50+
try:
51+
np.array([0]).sum(axis=5)
52+
except Exception as e:
53+
AxisError = type(e)
4854

4955
def validate_axis(axis, ndim):
5056
""" Validate an input to axis= keywords """

0 commit comments

Comments
 (0)