dataFrame.column.compare — startsWith()

Description

The startsWith() method of the compare object returns a boolean mask indicating which values start with the specified string.

Signature

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

Arguments

columnName (string)
The name of the column to compare values from.
string (string)
The string to match at the start of each value.

Returns

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

Example

// higlight rows where value starts with 'b' in the column 'pet'
var mask = df.column('pet').compare.startsWith('b');

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