Return the cumulative product of the array elements over the given 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. Refer to `numpy.cumprod` for full d
(self, axis=None, dtype=None, out=None)
| 5343 | product = prod |
| 5344 | |
| 5345 | def cumprod(self, axis=None, dtype=None, out=None): |
| 5346 | """ |
| 5347 | Return the cumulative product of the array elements over the given axis. |
| 5348 | |
| 5349 | Masked values are set to 1 internally during the computation. |
| 5350 | However, their position is saved, and the result will be masked at |
| 5351 | the same locations. |
| 5352 | |
| 5353 | Refer to `numpy.cumprod` for full documentation. |
| 5354 | |
| 5355 | Notes |
| 5356 | ----- |
| 5357 | The mask is lost if `out` is not a valid MaskedArray ! |
| 5358 | |
| 5359 | Arithmetic is modular when using integer types, and no error is |
| 5360 | raised on overflow. |
| 5361 | |
| 5362 | See Also |
| 5363 | -------- |
| 5364 | numpy.ndarray.cumprod : corresponding function for ndarrays |
| 5365 | numpy.cumprod : equivalent function |
| 5366 | """ |
| 5367 | result = self.filled(1).cumprod(axis=axis, dtype=dtype, out=out) |
| 5368 | if out is not None: |
| 5369 | if isinstance(out, MaskedArray): |
| 5370 | out.__setmask__(self._mask) |
| 5371 | return out |
| 5372 | result = result.view(type(self)) |
| 5373 | result.__setmask__(self._mask) |
| 5374 | return result |
| 5375 | |
| 5376 | def mean(self, axis=None, dtype=None, out=None, keepdims=np._NoValue): |
| 5377 | """ |