Skip to content

Commit 1e7a1d3

Browse files
drnextgisshoyer
authored andcommitted
np.AxisError was added in numpy 1.13 (#2455)
1 parent 8fb57f7 commit 1e7a1d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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)