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)
| 5273 | product = prod |
| 5274 | |
| 5275 | def cumprod(self, axis=None, dtype=None, out=None): |
| 5276 | """ |
| 5277 | Return the cumulative product of the array elements over the given axis. |
| 5278 | |
| 5279 | Masked values are set to 1 internally during the computation. |
| 5280 | However, their position is saved, and the result will be masked at |
| 5281 | the same locations. |
| 5282 | |
| 5283 | Refer to `numpy.cumprod` for full documentation. |
| 5284 | |
| 5285 | Notes |
| 5286 | ----- |
| 5287 | The mask is lost if `out` is not a valid MaskedArray ! |
| 5288 | |
| 5289 | Arithmetic is modular when using integer types, and no error is |
| 5290 | raised on overflow. |
| 5291 | |
| 5292 | See Also |
| 5293 | -------- |
| 5294 | numpy.ndarray.cumprod : corresponding function for ndarrays |
| 5295 | numpy.cumprod : equivalent function |
| 5296 | """ |
| 5297 | result = self.filled(1).cumprod(axis=axis, dtype=dtype, out=out) |
| 5298 | if out is not None: |
| 5299 | if isinstance(out, MaskedArray): |
| 5300 | out.__setmask__(self._mask) |
| 5301 | return out |
| 5302 | result = result.view(type(self)) |
| 5303 | result.__setmask__(self._mask) |
| 5304 | return result |
| 5305 | |
| 5306 | def mean(self, axis=None, dtype=None, out=None, keepdims=np._NoValue): |
| 5307 | """ |