dataFrame.column.stat — cumProp()
Description
The cumProp() method of the stat object returns an array containing the cumulative proportions of the values in the selected column.
Signature
dataFrame.column(columnName).stat.cumProp()Argument
columnName(string)- The name of the column from which to calculate the cumulative proportions.
Returns
mask( number[] )- An array containing the cumulative proportions.
Example
// get cumulative proportions from values of a column of the dataFrame
var mask = dataFrame.column('revenue').stat.cumProp();
// add the proportions to the dataFrame
dataFrame.column('proportions').set(mask);