diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-08-10 12:48:04 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-08-10 12:48:04 +0000 |
commit | c6f48c8a03c438da6e2d400752eff702d1234cfc (patch) | |
tree | fd032d49f4da991a440e64b462ccc60c3c02de55 /numpy/oldnumeric | |
parent | b772c977e5d4d71c78919ef941858ad438ee4986 (diff) | |
download | numpy-c6f48c8a03c438da6e2d400752eff702d1234cfc.tar.gz |
Add output arguments to a few more functions for consistency
Diffstat (limited to 'numpy/oldnumeric')
-rw-r--r-- | numpy/oldnumeric/functions.py | 13 | ||||
-rw-r--r-- | numpy/oldnumeric/misc.py | 10 |
2 files changed, 16 insertions, 7 deletions
diff --git a/numpy/oldnumeric/functions.py b/numpy/oldnumeric/functions.py index 3041a6159..e18f12aa8 100644 --- a/numpy/oldnumeric/functions.py +++ b/numpy/oldnumeric/functions.py @@ -6,10 +6,10 @@ import numpy.core.numeric as nn from typeconv import convtypecode, convtypecode2 __all__ = ['take', 'repeat', 'sum', 'product', 'sometrue', 'alltrue', - 'cumsum', 'cumproduct', + 'cumsum', 'cumproduct', 'compress', 'ones', 'empty', 'identity', 'zeros', 'array', 'asarray', 'nonzero', 'reshape', 'arange', 'fromstring', 'ravel', 'trace', - 'indices', 'where','sarray','cross_product'] + 'indices', 'where','sarray','cross_product', 'argmax', 'argmin'] def take(a, indicies, axis=0): return N.take(a, indicies, axis) @@ -34,6 +34,15 @@ def cumsum(x, axis=0): def cumproduct(x, axis=0): return N.cumproduct(x, axis) + +def argmax(x, axis=-1): + return N.argmax(x, axis) + +def argmin(x, axis=-1): + return N.argmax(x, axis) + +def compress(condition, m, axis=-1): + return N.compress(condition, m, axis) def ones(shape, typecode='l', savespace=0, dtype=None): """ones(shape, dtype=int) returns an array of the given diff --git a/numpy/oldnumeric/misc.py b/numpy/oldnumeric/misc.py index a9bd57264..e8c2e3c00 100644 --- a/numpy/oldnumeric/misc.py +++ b/numpy/oldnumeric/misc.py @@ -3,11 +3,11 @@ __all__ = ['load', 'sort', 'copy_reg', 'clip', 'putmask', 'Unpickler', 'rank', 'sign', 'shape', 'types', 'allclose', 'size', - 'argmax', 'choose', 'swapaxes', 'array_str', - 'pi', 'math', 'compress', 'concatenate', + 'choose', 'swapaxes', 'array_str', + 'pi', 'math', 'concatenate', 'around', 'vdot', 'transpose', 'array2string', 'diagonal', 'searchsorted', 'put', 'fromfunction', 'copy', 'resize', - 'array_repr', 'e', 'argmin', 'StringIO', 'pickle', 'average', + 'array_repr', 'e', 'StringIO', 'pickle', 'average', 'argsort', 'convolve', 'loads', 'cross_correlate', 'Pickler', 'dot', 'outerproduct', 'innerproduct'] @@ -20,8 +20,8 @@ import copy_reg from pickle import load, loads from numpy import sort, clip, putmask, rank, sign, shape, allclose, size,\ - argmax, choose, swapaxes, array_str, array_repr, argmin, e, pi, \ - fromfunction, resize, around, compress, concatenate, vdot, transpose, \ + choose, swapaxes, array_str, array_repr, e, pi, \ + fromfunction, resize, around, concatenate, vdot, transpose, \ diagonal, searchsorted, put, average, argsort, convolve, dot, \ outer as outerproduct, inner as innerproduct, correlate as cross_correlate |