maxframe.liteframe.LiteFrame.cumprod#

LiteFrame.cumprod(skipna=True, columns=None)#

Cumulative prod of column values, preserving row order.

NaN positions are masked (the output is null where the input is null) when skipna=True. When skipna=False, NaN propagates forward — once a null is encountered, all subsequent values become null.

Parameters:
  • skipna (bool, default True) – If True, skip null values in the cumulative computation but mask their positions to null in the output. If False, null propagates forward (all subsequent values become null).

  • columns (str, list of str, or None, default None) – Column(s) to transform. If None, all columns are transformed. Non-selected columns are passed through unchanged.

Returns:

Cumulative prod LiteFrame with same shape and columns.

Return type:

LiteFrame

Raises:

TypeError – If any transformed column is non-numeric, or if cumprod is called on a decimal column (cumprod only — polars cum_prod does not support decimal).

Examples

>>> import maxframe.liteframe as mlf
>>> lf = mlf.LiteFrame({'a': [1, 2, 3, 4]})
>>> result = lf.cumprod()
>>> result.execute()
   a
    0   1.0
    1   2.0
    2   6.0
    3  24.0