dataFrame.column.compare — isOdd()
Description
The isOdd() method of the compare object returns a boolean mask indicating which values are odd numbers.
Signature
dataFrame.column(columnName).compare.isOdd()Argument
columnName(string)- The name of the column to compare values from.
Returns
mask( boolean[] )- A boolean mask indicating the rows whose values are odd numbers.
- Even value:
1 - Otherwise:
0
- Even value:
Example
// get the mask of rows where the column 'age' is odd
var mask = df.column('age').compare.isOdd();
// set mask to dataFrame
df.column('age_odd').set(mask);