Skip to content

Commit

Permalink
np.AxisError was added in numpy 1.13
Browse files Browse the repository at this point in the history
  • Loading branch information
drnextgis committed Oct 2, 2018
1 parent f9c4169 commit ac2c568
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xarray/core/dask_array_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ def isin(element, test_elements, assume_unique=False, invert=False):
import math
from numbers import Integral, Real

AxisError = np.AxisError
try:
AxisError = np.AxisError
except AttributeError:
try:
np.array([0]).sum(axis=5)
except Exception as e:
AxisError = type(e)

def validate_axis(axis, ndim):
""" Validate an input to axis= keywords """
Expand Down

0 comments on commit ac2c568

Please sign in to comment.