MaskedArray.cumprod(axis=None, dtype=None, out=None)[source]
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.
Masked values are set to 1 internally during the computation. However, their position is saved, and the result will be masked at the same locations.
Parameters: |
axis : {None, -1, int}, optional Axis along which the product is computed. The default ( dtype : {None, dtype}, optional Determines the type of the returned array and of the accumulator where the elements are multiplied. If 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. |
The mask is lost if out
is not a valid MaskedArray !
Arithmetic is modular when using integer types, and no error is raised on overflow.
© 2008–2016 NumPy Developers
Licensed under the NumPy License.
https://docs.scipy.org/doc/numpy-1.11.0/reference/generated/numpy.ma.MaskedArray.cumprod.html