dataFrame.column.compare — contains()

Description

The contains() method of the compare object returns a boolean mask indicating which values contain the specified string.

Signature

dataFrame.column(columnName).compare.contains(string)
Scope
column
Family
compare
Returns
mask

Arguments

columnName (string)
The name of the column to compare values from.
string (string)
The string to search for.

Returns

mask ( boolean[] )
A boolean mask indicating the rows whose values contain the specified string.
  • Contains the string: 1
  • Otherwise: 0

Example

// higlight rows where the column 'name' contains 'john'
var mask = df.column('name').compare.contains('john');

// set mask to dataFrame
df.column('has_john').set(mask)