You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [21]: a = np.empty(shape=(0,0))
In [22]: np.lib.apply_along_axis(sum, 1, a)
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-22-2fcce4e707fd> in <module>()
----> 1 np.lib.apply_along_axis(sum, 1, a)
myvirtualenv/lib/python2.7/site-packages/numpy-1.9.2-py2.7-linux-x86_64.egg/numpy/lib/shape_base.pyc in apply_along_axis(func1d, axis, arr, *args, **kwargs)
89 outshape = asarray(arr.shape).take(indlist)
90 i.put(indlist, ind)
---> 91 res = func1d(arr[tuple(i.tolist())], *args, **kwargs)
92 # if res is a number, then we have a smaller output array
93 if isscalar(res):
IndexError: index 0 is out of bounds for axis 0 with size 0
The text was updated successfully, but these errors were encountered:
What do you think the correct behaviour here is? It's impossible to know what dtype of value to return without invoking the function. So should we invoke the function on an array of garbage?
As of #8441, this now raises StopIteration instead, which is even worse, as it could cause silent failures in iterator
The text was updated successfully, but these errors were encountered: