Compute running totals, products, maxima, and minima. Mirrors
pandas.Series.cumsum() / cumprod() /
cummax() / cummin().
Edit any code block below and press ▶ Run
(or Ctrl+Enter) to execute it live in your browser.
cumsum(series) returns a new Series where each value is the sum of all
preceding values plus the current one. Mirrors
pandas.Series.cumsum().
cumprod(series) returns a new Series where each value is the product of all
values up to and including that position. Mirrors
pandas.Series.cumprod().
cummax(series) tracks the running maximum;
cummin(series) tracks the running minimum. Both work on numbers,
strings, and booleans.
By default skipna: true: missing values return
NaN/null in the result but do not
affect the running accumulator.
With skipna: false, any missing value poisons all subsequent results.
dataFrameCumsum(df) applies the operation independently to each column
(axis=0 is the default, same as pandas).
With axis: 1 (or axis: "columns"), the operation is applied
across columns for each row — each cell becomes the cumulative value of all columns
to its left plus itself.
Track the running portfolio value and the running drawdown (how far we are from the
all-time high) using cumsum and cummax.
cummax and cummin work on any comparable type, including
strings (lexicographic ordering).
All cumulative functions accept a Series (or DataFrame variant) and return a new
Series/DataFrame of the same shape. The skipna option controls
missing-value handling; axis controls direction for DataFrames.
// Series cumulative operations
cumsum(series, { skipna?: boolean }): Series
cumprod(series, { skipna?: boolean }): Series
cummax(series, { skipna?: boolean }): Series
cummin(series, { skipna?: boolean }): Series
// DataFrame cumulative operations
dataFrameCumsum(df, { axis?: 0 | 1, skipna?: boolean }): DataFrame
dataFrameCumprod(df, { axis?: 0 | 1, skipna?: boolean }): DataFrame
dataFrameCummax(df, { axis?: 0 | 1, skipna?: boolean }): DataFrame
dataFrameCummin(df, { axis?: 0 | 1, skipna?: boolean }): DataFrame