summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorMatthew Brett <matthew.brett@gmail.com>2008-02-19 23:49:50 +0000
committerMatthew Brett <matthew.brett@gmail.com>2008-02-19 23:49:50 +0000
commit9555d91ebfed2f886c932953bba6ae207dc69eae (patch)
tree123a192236cdcd33b3d946a93d0ac5fda9743153 /numpy/core/fromnumeric.py
parent31748384403cc3f58d9607f8ffaa60216a2e7e5d (diff)
downloadnumpy-9555d91ebfed2f886c932953bba6ae207dc69eae.tar.gz
cumprod docstring, median input array coercion
Diffstat (limited to 'numpy/core/fromnumeric.py')
-rw-r--r--numpy/core/fromnumeric.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/numpy/core/fromnumeric.py b/numpy/core/fromnumeric.py
index 9bfaeba4d..b1665a932 100644
--- a/numpy/core/fromnumeric.py
+++ b/numpy/core/fromnumeric.py
@@ -1061,6 +1061,33 @@ def prod(a, axis=None, dtype=None, out=None):
def cumprod(a, axis=None, dtype=None, out=None):
"""Return the cumulative product of the elements along the given axis.
+ The cumulative product is taken over the flattened array by
+ default, otherwise over the specified axis.
+
+ Parameters
+ ----------
+ a : array-like
+ Input array or object that can be converted to an array
+ axis : {None, -1, int}, optional
+ Axis along which the product is computed. The default
+ (``axis``= None) is to compute over the flattened array.
+ dtype : type, optional
+ Type to use in computing the cumulative product. For arrays of
+ integer type the default is int64 for signed ints and uint64
+ for unsigned. For arrays of float types it is the same as the
+ array type.
+ out : ndarray, optional
+ Alternative output array in which to place the result. It must
+ have the same shape and buffer length as the expected output
+ but the type will be cast if necessary.
+
+ Returns
+ -------
+ cumprod : ndarray.
+ A new array holding the result is returned unless out is
+ specified, in which case a reference to out is returned.
+ Return datatype is ``dtype`` if specified, otherwise int64 for
+ ints, uint64 for uints, or the input datatype otherwise.
"""
try:
cumprod = a.cumprod