Skip to content

Commit

Permalink
DOC: Update ufunc documentation (#9141)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
shitian-ni authored and mhvk committed May 19, 2017
1 parent 1ec9ad6 commit d090484
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions doc/source/reference/ufuncs.rst
Expand Up @@ -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* :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. 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 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 will take place (with negative values counting backwards). Generally, it is an
*dtype* keyword allows you to manage a very common problem that arises integer, though for :meth:`ufunc.reduce`, it can also be a tuple of `int` to
when naively using :ref:`{op}.reduce <ufunc.reduce>`. Sometimes you may 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 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 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 array. This commonly happens if you have an array of single-byte
Expand Down

0 comments on commit d090484

Please sign in to comment.