summaryrefslogtreecommitdiff
path: root/numpy/lib/shape_base.py
diff options
context:
space:
mode:
authorBen Rowland <bennyrowland@mac.com>2016-12-31 16:52:47 +0000
committerCharles Harris <charlesr.harris@gmail.com>2016-12-31 09:52:47 -0700
commitb1b67d65503b46f7da04785656b145ee82cc0157 (patch)
tree24054cb43aaa34bde12234eb4841dccedd7881d5 /numpy/lib/shape_base.py
parent3add9ed2d7c93215db9bdfd9a3accaa341ce3647 (diff)
downloadnumpy-b1b67d65503b46f7da04785656b145ee82cc0157.tar.gz
BUG: Fix apply_along_axis() for when func1d() returns a non-ndarray (#8426)
* BUG: Closes issue #8419 Fixes issue in apply_along_axis() where func1d() returns a non ndarray * BUG: Fix apply_along_axis() when func1d() returns a non-ndarray Closes issue #8419. Fixes issue in apply_along_axis() where func1d() returns a non ndarray by calling asanyarray() on result. This commit fixes a too long line in the test case.
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r--numpy/lib/shape_base.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py
index e580690d1..6e92aa041 100644
--- a/numpy/lib/shape_base.py
+++ b/numpy/lib/shape_base.py
@@ -127,7 +127,7 @@ def apply_along_axis(func1d, axis, arr, *args, **kwargs):
ind[n] = 0
n -= 1
i.put(indlist, ind)
- res = func1d(arr[tuple(i.tolist())], *args, **kwargs)
+ res = asanyarray(func1d(arr[tuple(i.tolist())], *args, **kwargs))
outarr[tuple(i.tolist())] = res
k += 1
if res.shape == ():