Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- shape_base.py 2014-03-06 13:18:57.014449386 +0100
- +++ /lib/python2.7/site-packages/numpy/lib/shape_base.py 2014-03-06 11:36:44.373984020 +0100
- @@ -10,7 +10,7 @@
- from numpy.core.fromnumeric import product, reshape
- from numpy.core import hstack, vstack, atleast_3d
- -def apply_along_axis(func1d,axis,arr,*args):
- +def apply_along_axis(func1d,axis,arr,*args,**moreargs):
- """
- Apply a function to 1-D slices along the given axis.
- @@ -76,7 +76,8 @@
- i[axis] = slice(None, None)
- outshape = asarray(arr.shape).take(indlist)
- i.put(indlist, ind)
- - res = func1d(arr[tuple(i.tolist())],*args)
- + print
- + res = func1d(arr[tuple(i.tolist())],*args,**moreargs)
- # if res is a number, then we have a smaller output array
- if isscalar(res):
- outarr = zeros(outshape, asarray(res).dtype)
- @@ -92,7 +93,7 @@
- ind[n] = 0
- n -= 1
- i.put(indlist, ind)
- - res = func1d(arr[tuple(i.tolist())],*args)
- + res = func1d(arr[tuple(i.tolist())],*args,**moreargs)
- outarr[tuple(ind)] = res
- k += 1
- return outarr
- @@ -113,7 +114,7 @@
- ind[n] = 0
- n -= 1
- i.put(indlist, ind)
- - res = func1d(arr[tuple(i.tolist())],*args)
- + res = func1d(arr[tuple(i.tolist())],*args,**moreargs)
- outarr[tuple(i.tolist())] = res
- k += 1
- return outarr
- @@ -832,4 +833,3 @@
- shape[i] = dim_out
- n //= max(dim_in, 1)
- return c.reshape(shape)
- -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement