Pandas Series: cumprod() function

Cumulative product of a Pandas series

The cumprod() function is used to get cumulative product over a DataFrame or Series axis.

Returns a DataFrame or Series of the same size containing the cumulative product.


Series.cumprod(self, axis=None, skipna=True, *args, **kwargs)
Pandas Series cumprod image


Name Description Type/Default Value Required / Optional
axis The index or the name of the axis. 0 is equivalent to None or ‘index’. {0 or ‘index’, 1 or ‘columns’}
Default Value: 0
skipna Exclude NA/null values. If an entire row/column is NA, the result will be NA. boolean
Default Value: True
*args, **kwargs Additional keywords have no effect but might be accepted for compatibility with NumPy. Required

Returns: scalar or Series


Download the above Notebook from here.

Previous: Cumulative minimum over a Pandas DataFrame or Series axis
Next: Cumulative sum over a Pandas DataFrame or Series axis