fillNA method

Datacat fillNA(
  1. String columnName,
  2. dynamic fillValue
)

Fills missing (null) values in the specified column with fillValue.

Implementation

Datacat fillNA(String columnName, dynamic fillValue) {
  int index = columns.indexOf(columnName);
  if (index == -1) throw ArgumentError('Column "$columnName" not found.');
  for (var row in rows) {
    if (row[index] == null) {
      row[index] = fillValue;
    }
  }
  return this;
}