From 8d47d697dad06116abe2b40ad6ee78f867292209 Mon Sep 17 00:00:00 2001 From: Allan Haldane Date: Sat, 28 Mar 2015 21:40:52 -0400 Subject: 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. --- numpy/core/fromnumeric.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'numpy/core/fromnumeric.py') 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): -- cgit v1.2.1