From c6f48c8a03c438da6e2d400752eff702d1234cfc Mon Sep 17 00:00:00 2001 From: Travis Oliphant Date: Thu, 10 Aug 2006 12:48:04 +0000 Subject: Add output arguments to a few more functions for consistency --- numpy/oldnumeric/functions.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'numpy/oldnumeric/functions.py') 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 -- cgit v1.2.1