diff options
author | Nathaniel Hellabyte <nate@hellabit.es> | 2013-12-19 17:19:52 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2015-12-18 11:08:39 -0700 |
commit | 4626b59a490bb5f35830a7b6bb74853a9c14aa63 (patch) | |
tree | c8913df8a623c3eaf2953d0d5faff46e62463437 /numpy/core/fromnumeric.py | |
parent | 3af5f0574740611076df9dc905330defab70a6dc (diff) | |
download | numpy-4626b59a490bb5f35830a7b6bb74853a9c14aa63.tar.gz |
DOC: Update docstrings of np.sum and np.prod.
* Improved language of sum doc for axis subheading. Added clarification
of important axis values--{0,1}->iterative {row,column} sum.
* Improved language of product axis subheading.
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r-- | numpy/core/fromnumeric.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py index 197513294..c95e00a41 100644 --- a/numpy/core/fromnumeric.py +++ b/numpy/core/fromnumeric.py @@ -1740,9 +1740,11 @@ def sum(a, axis=None, dtype=None, out=None, keepdims=False): Elements to sum. axis : None or int or tuple of ints, optional Axis or axes along which a sum is performed. - The default (`axis` = `None`) is perform a sum over all - the dimensions of the input array. `axis` may be negative, in + The default (`axis` = `None`) will sum all of the elements + of the input array. `axis` may be negative, in which case it counts from the last to the first axis. + `axis` = 0 or 1 will sum over the elements of the + columns or rows of the input array. .. versionadded:: 1.7.0 @@ -2393,8 +2395,8 @@ def prod(a, axis=None, dtype=None, out=None, keepdims=False): Input data. axis : None or int or tuple of ints, optional Axis or axes along which a product is performed. - The default (`axis` = `None`) is perform a product over all - the dimensions of the input array. `axis` may be negative, in + The default (`axis` = `None`) will calculate the product + of all the elements in the input array. `axis` may be negative, in which case it counts from the last to the first axis. .. versionadded:: 1.7.0 |