diff options
author | Allan Haldane <allan.haldane@gmail.com> | 2015-03-28 21:40:52 -0400 |
---|---|---|
committer | Allan Haldane <allan.haldane@gmail.com> | 2015-04-02 22:58:10 -0400 |
commit | 8d47d697dad06116abe2b40ad6ee78f867292209 (patch) | |
tree | 4ca0747dccca27b2c989897638c1bfa5743e6bb0 /numpy/core/fromnumeric.py | |
parent | 061aa26e1b772d46d3b97018cabb7d01637284cd (diff) | |
download | numpy-8d47d697dad06116abe2b40ad6ee78f867292209.tar.gz |
ENH sync ndarray methods doc/args with numpy function doc/args
Modified the docstrings to all, any, sum, prod, mean, var, std, min, max
to add keepdims argument.
Added 'out' keyword parameter to numpy.argmin, numpy.argmax, to mirror
ndarray methods.
Updated ndarray.clip docstring to give correct parameter description.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index b0c141178..549647df2 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -900,7 +900,7 @@ def argsort(a, axis=-1, kind='quicksort', order=None): return argsort(axis, kind, order) -def argmax(a, axis=None): +def argmax(a, axis=None, out=None): """ Returns the indices of the maximum values along an axis. @@ -911,6 +911,9 @@ def argmax(a, axis=None): axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. + out : array, optional + If provided, the result will be inserted into this array. It should + be of the appropriate shape and dtype. Returns ------- @@ -953,11 +956,11 @@ def argmax(a, axis=None): try: argmax = a.argmax except AttributeError: - return _wrapit(a, 'argmax', axis) - return argmax(axis) + return _wrapit(a, 'argmax', axis, out) + return argmax(axis, out) -def argmin(a, axis=None): +def argmin(a, axis=None, out=None): """ Returns the indices of the minimum values along an axis. @@ -968,6 +971,9 @@ def argmin(a, axis=None): axis : int, optional By default, the index is into the flattened array, otherwise along the specified axis. + out : array, optional + If provided, the result will be inserted into this array. It should + be of the appropriate shape and dtype. Returns ------- @@ -1010,8 +1016,8 @@ def argmin(a, axis=None): try: argmin = a.argmin except AttributeError: - return _wrapit(a, 'argmin', axis) - return argmin(axis) + return _wrapit(a, 'argmin', axis, out) + return argmin(axis, out) def searchsorted(a, v, side='left', sorter=None): |