diff options
author | Mark Wiebe <mwiebe@enthought.com> | 2011-08-02 17:25:11 -0500 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-08-27 07:26:50 -0600 |
commit | ea5dcd7947615678bda053ed65ab921fec6f1421 (patch) | |
tree | 6f58d6dc44bcd4f34f38422bb48629082dc9b0cc /numpy/add_newdocs.py | |
parent | 90c6172ee5740009fe51da84df279d182c9a3b55 (diff) | |
download | numpy-ea5dcd7947615678bda053ed65ab921fec6f1421.tar.gz |
DOC: ufunc: Document the 'axis=' improvments to reduction functions
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 536cde9d1..95379d611 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -5299,8 +5299,22 @@ add_newdoc('numpy.core', 'ufunc', ('reduce', ---------- a : array_like The array to act on. - axis : int, optional - The axis along which to apply the reduction. + axis : None or int or tuple of ints, optional + Axis or axes along which a reduction is performed. + The default (`axis` = 0) is perform a reduction over the first + dimension of the input array. `axis` may be negative, in + which case it counts from the last to the first axis. + + .. versionadded:: 1.7.0 + + If this is `None`, a reduction is performed over all the axes. + If this is a tuple of ints, a reduction is performed on multiple + axes, instead of a single axis or all the axes as before. + + For operations which are either not commutative or not associative, + doing a reduction over multiple axes is not well-defined. The + ufuncs do not currently raise an exception in this case, but will + likely do so in the future. dtype : data-type code, optional The type used to represent the intermediate results. Defaults to the data-type of the output array if this is provided, or |