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