dataFrame.rows — forEach()

Description

The forEach() method of the rows object executes the specified function once for each row of the DataFrame.

Signature

dataFrame.rows.filter(function)
Scope
dataFrame
Family
rows
Returns
array

Argument

function (function)
A function to execute for each row. The function receives a row object representing the current row. Column values can be accessed using column names:
  • row["name"]
  • row["age"]

Example

// log rows where value in the column 'age' is greater than or equal to 18
dataFrame.rows.forEach(function(row) {
  if (row["age"] >= 18) {
    notebook.log(row);
  }
});