diff options
author | Tim Leslie <tim.leslie@gmail.com> | 2007-01-08 04:01:52 +0000 |
---|---|---|
committer | Tim Leslie <tim.leslie@gmail.com> | 2007-01-08 04:01:52 +0000 |
commit | 0f1df3fcfcdb4527ff2c332ddf7504b6b60e2813 (patch) | |
tree | 780d627d0361672997d85acdde78c01f4cd6ab49 /numpy/lib/shape_base.py | |
parent | 2e832de49f69d26eb7c8d133e45f9b9d99f7a3a6 (diff) | |
download | numpy-0f1df3fcfcdb4527ff2c332ddf7504b6b60e2813.tar.gz |
fix for #407 and add unit test for it
Diffstat (limited to 'numpy/lib/shape_base.py')
-rw-r--r-- | numpy/lib/shape_base.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index cfe768bfd..32c47ede5 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -31,7 +31,7 @@ def apply_along_axis(func1d,axis,arr,*args): # if res is a number, then we have a smaller output array if isscalar(res): outarr = zeros(outshape,asarray(res).dtype) - outarr[ind] = res + outarr[tuple(ind)] = res Ntot = product(outshape) k = 1 while k < Ntot: @@ -44,7 +44,7 @@ def apply_along_axis(func1d,axis,arr,*args): n -= 1 i.put(indlist,ind) res = func1d(arr[tuple(i.tolist())],*args) - outarr[ind] = res + outarr[tuple(ind)] = res k += 1 return outarr else: |