dataFrame.column.stat — cumSum()

Description

The cumSum() method of the stat object returns the cumulative sum of the values in the selected column.

Signature

dataFrame.column(columnName).stat.cumSum()
Scope
column
Family
stat
Returns
array

Argument

columnName (string)
The name of the column from which to calculate the cumulative sums.

Returns

mask ( number[] )
An array containing the cumulative sums.

Example

// get cumulative sums from values of a column of the dataFrame
var mask = dataFrame.column('revenue').stat.cumSum();

// add the sums to the dataFrame
dataFrame.column('sum').set(mask);