Skip to content

gaslamp


Type Alias: ColumnMapper

ColumnMapper = (row, i) => Cell

Mapper function for withColumn.

Receives a row as Map<string, Cell> and its 0-based index. Must return a Cell value for the new or updated column.

Parameters

row

Map\<string, Cell>

i

number

Returns

Cell

Example

TypeScript
const double: ColumnMapper = (row) => (row.get("age") as number) * 2;
df.withColumn("doubled", double);