dataFrame.column.compare — isMax()
Description
The isMax() method of the compare object returns a boolean mask indicating which rows contain the maximum value of the selected column. Multiple matches may be returned when the maximum value appears more than once.
Signature
dataFrame.column(columnName).compare.isMax()Argument
columnName(string)- The name of the column to compare values from.
Returns
mask( boolean[] )- A boolean mask indicating the rows whose values are equal to the maximum value of the selected column.
- Max value:
1 - Otherwise:
0
- Max value:
Example
// get the mask of rows where the column 'age' is the max
var mask = df.column('age').compare.isMax();
// set mask to dataFrame
df.column('age_max').set(mask);