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