diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-05-18 10:32:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 10:32:48 +0100 |
commit | 1ec9ad692e38654b70b77d92b74e841d7255e109 (patch) | |
tree | a4d8e5419cbb1ab6b2097349eb6db39b14975597 /numpy/add_newdocs.py | |
parent | fe16f8322e7a45269df7d1631e9ac6216d17f05f (diff) | |
parent | ca49f0b11bc88056bf4767ac439b298cfda16fed (diff) | |
download | numpy-1ec9ad692e38654b70b77d92b74e841d7255e109.tar.gz |
Merge pull request #9106 from mhvk/array_ufunc_reduce_out_tuple
BUG: Array ufunc reduce out tuple
Diffstat (limited to 'numpy/add_newdocs.py')
-rw-r--r-- | numpy/add_newdocs.py | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/numpy/add_newdocs.py b/numpy/add_newdocs.py index 8a016c966..05fb73df4 100644 --- a/numpy/add_newdocs.py +++ b/numpy/add_newdocs.py @@ -5444,9 +5444,11 @@ add_newdoc('numpy.core', 'ufunc', ---------- *x : array_like Input arrays. - out : ndarray or tuple of ndarray, optional + out : ndarray, None, or tuple of ndarray and None, optional Alternate array object(s) in which to put the result; if provided, it - must have a shape that the inputs broadcast to. + must have a shape that the inputs broadcast to. A tuple of arrays + (possible only as a keyword argument) must have length equal to the + number of outputs; use `None` for outputs to be allocated by the ufunc. where : array_like, optional Values of True indicate to calculate the ufunc at that position, values of False indicate to leave the value in the output alone. @@ -5667,9 +5669,14 @@ add_newdoc('numpy.core', 'ufunc', ('reduce', The type used to represent the intermediate results. Defaults to the data-type of the output array if this is provided, or the data-type of the input array if no output array is provided. - out : ndarray, optional - A location into which the result is stored. If not provided, a - freshly-allocated array is returned. + out : ndarray, None, or tuple of ndarray and None, optional + A location into which the result is stored. If not provided or `None`, + a freshly-allocated array is returned. For consistency with + :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a + 1-element tuple. + + .. versionchanged:: 1.13.0 + Tuples are allowed for keyword argument. keepdims : bool, optional If this is set to True, the axes which are reduced are left in the result as dimensions with size one. With this option, @@ -5741,9 +5748,14 @@ add_newdoc('numpy.core', 'ufunc', ('accumulate', The data-type used to represent the intermediate results. Defaults to the data-type of the output array if such is provided, or the the data-type of the input array if no output array is provided. - out : ndarray, optional - A location into which the result is stored. If not provided a - freshly-allocated array is returned. + out : ndarray, None, or tuple of ndarray and None, optional + A location into which the result is stored. If not provided or `None`, + a freshly-allocated array is returned. For consistency with + :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a + 1-element tuple. + + .. versionchanged:: 1.13.0 + Tuples are allowed for keyword argument. keepdims : bool Has no effect. Deprecated, and will be removed in future. @@ -5820,9 +5832,14 @@ add_newdoc('numpy.core', 'ufunc', ('reduceat', The type used to represent the intermediate results. Defaults to the data type of the output array if this is provided, or the data type of the input array if no output array is provided. - out : ndarray, optional - A location into which the result is stored. If not provided a - freshly-allocated array is returned. + out : ndarray, None, or tuple of ndarray and None, optional + A location into which the result is stored. If not provided or `None`, + a freshly-allocated array is returned. For consistency with + :ref:`ufunc.__call__`, if given as a keyword, this may be wrapped in a + 1-element tuple. + + .. versionchanged:: 1.13.0 + Tuples are allowed for keyword argument. Returns ------- |