larray.Array.cumprod
- Array.cumprod(axis=-1) Union[Array, bool, int, float, str, bytes, generic] [source]
Return the cumulative product of array elements.
- Parameters
- axisint or str or Axis, optional
Axis along which to perform the cumulative product. If given as position, it can be a negative integer, in which case it counts from the last to the first axis. By default, the cumulative product is performed along the last axis.
- Returns
- Array or scalar
See also
Notes
Cumulative aggregation functions accept only one axis.
Examples
>>> arr = ndtest((4, 4)) >>> arr a\b b0 b1 b2 b3 a0 0 1 2 3 a1 4 5 6 7 a2 8 9 10 11 a3 12 13 14 15 >>> arr.cumprod() a\b b0 b1 b2 b3 a0 0 0 0 0 a1 4 20 120 840 a2 8 72 720 7920 a3 12 156 2184 32760 >>> arr.cumprod('a') a\b b0 b1 b2 b3 a0 0 1 2 3 a1 0 5 12 21 a2 0 45 120 231 a3 0 585 1680 3465