diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-29 06:52:33 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-29 06:52:33 +0000 |
commit | 936b14b2363d0b57aaa109b255d332d222704640 (patch) | |
tree | 3023a450c63efcc3d6441ba0945299859157efec | |
parent | 7b9df715cabe56f14d09a97b7b4b2bf524a3706e (diff) | |
download | numpy-936b14b2363d0b57aaa109b255d332d222704640.tar.gz |
Add axis argument to usages of take
-rw-r--r-- | numpy/lib/arraysetops.py | 8 | ||||
-rw-r--r-- | numpy/lib/shape_base.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/numpy/lib/arraysetops.py b/numpy/lib/arraysetops.py index 7bd666029..cc9067712 100644 --- a/numpy/lib/arraysetops.py +++ b/numpy/lib/arraysetops.py @@ -66,7 +66,7 @@ def unique1d( ar1, retindx = False ): if retindx: ar = numpy.array(ar1).ravel() perm = ar.argsort() - aux = ar.take(perm) + aux = ar.take(perm,0) flag = ediff1d( aux, 1 ) != 0 return perm.compress(flag), aux.compress(flag) else: @@ -113,8 +113,8 @@ def setmember1d( ar1, ar2 ): tt = concat( (zlike( ar1 ), zlike( ar2 ) + 1) ) perm = ar.argsort() - aux = ar.take(perm) - aux2 = tt.take(perm) + aux = ar.take(perm,0) + aux2 = tt.take(perm,0) flag = ediff1d( aux, 1 ) == 0 ii = numpy.where( flag * aux2 )[0] @@ -124,7 +124,7 @@ def setmember1d( ar1, ar2 ): indx = perm.argsort()[:len( ar1 )] - return flag.take( indx ) + return flag.take( indx , 0) ## # 03.11.2005, c diff --git a/numpy/lib/shape_base.py b/numpy/lib/shape_base.py index df0e9876d..925329cdf 100644 --- a/numpy/lib/shape_base.py +++ b/numpy/lib/shape_base.py @@ -25,7 +25,7 @@ def apply_along_axis(func1d,axis,arr,*args): indlist = range(nd) indlist.remove(axis) i[axis] = slice(None,None) - outshape = asarray(arr.shape).take(indlist) + outshape = asarray(arr.shape).take(indlist,0) i.put(ind, indlist) res = func1d(arr[tuple(i.tolist())],*args) # if res is a number, then we have a smaller output array |