diff options
author | Shitian Ni <shitian.ni@gmail.com> | 2017-05-20 06:26:17 +0900 |
---|---|---|
committer | Marten van Kerkwijk <mhvk@astro.utoronto.ca> | 2017-05-19 17:26:17 -0400 |
commit | d090484f8ec0daae720e79169e1a853f84e6deb4 (patch) | |
tree | 436199540ffa46effadb2170d8a188541b555150 | |
parent | 1ec9ad692e38654b70b77d92b74e841d7255e109 (diff) | |
download | numpy-d090484f8ec0daae720e79169e1a853f84e6deb4.tar.gz |
DOC: Update ufunc documentation (#9141)
* DOC: Update ufuncs.rst to mention the option of an axis tuple
fixes issue gh-9131.
ufuncs.rst now mentions that the axis may be assigned a tuple of int for reduce.
Also fixed broken "{op}.reduce" link on the webpage in the same article.
-rw-r--r-- | doc/source/reference/ufuncs.rst | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/doc/source/reference/ufuncs.rst b/doc/source/reference/ufuncs.rst index 9a8d8e20e..de6065dcc 100644 --- a/doc/source/reference/ufuncs.rst +++ b/doc/source/reference/ufuncs.rst @@ -429,9 +429,11 @@ Attempting to call these methods on other ufuncs will cause a :exc:`ValueError`. The reduce-like methods all take an *axis* keyword, a *dtype* keyword, and an *out* keyword, and the arrays must all have dimension >= 1. The *axis* keyword specifies the axis of the array over which the reduction -will take place and may be negative, but must be an integer. The -*dtype* keyword allows you to manage a very common problem that arises -when naively using :ref:`{op}.reduce <ufunc.reduce>`. Sometimes you may +will take place (with negative values counting backwards). Generally, it is an +integer, though for :meth:`ufunc.reduce`, it can also be a tuple of `int` to +reduce over several axes at once, or `None`, to reduce over all axes. +The *dtype* keyword allows you to manage a very common problem that arises +when naively using :meth:`ufunc.reduce`. Sometimes you may have an array of a certain data type and wish to add up all of its elements, but the result does not fit into the data type of the array. This commonly happens if you have an array of single-byte |