dataFrame.column.stat — rankEq()

Description

The rankEq() method of the stat object returns an array containing the ranks of the values in the selected column.

Signature

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

Argument

columnName (string)
The name of the column containing the values to assign ranks.

Returns

mask (array)
An array containing the rank associated with each value in the selected column. Tied values receive the same rank.

Note

When multiple values are equal, they are assigned the same rank, consistent with the ranking method used by Excel's RANK.EQ function.

Example

// get the ranks of values of a column of the dataFrame
var mask = dataFrame.column('revenue').stat.rankEq();

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