dataFrame.column.compare — outside()

Description

The outside() method of the compare object returns a boolean mask indicating which values fall outside the specified minimum and maximum values. Boundaries can be included or excluded using the inclusive option.

Signature

dataFrame.column(columnName).compare.outside(minValue, maxValue, { inclusive: false })
Scope
column
Family
compare
Returns
mask

Arguments

columnName (string)
The name of the column to compare values from.
minValue (number)
The lower bound of the comparison range.
maxValue (number)
The upper bound of the comparison range.
options (object)
Comparison options.

Option

inclusive (boolean)
Whether the range boundaries should be included in the comparison.
  • Is inclusive: 1
  • Is not inclusive: 0
  • Default: 0

Returns

mask ( boolean[] )
A boolean mask indicating the rows whose values fall outside the specified range.
  • Between the values: 1
  • Otherwise: 0

Example

// higlight rows where the 'revenue' falls outside of of the range 1000 - 2000
var mask = df.column('revenue').compare.outside(1000, 2000);

// set mask to dataFrame
df.column('outside_1-2k').set(mask)