expr

inline fun <T, reified R> ColumnsSelectionDsl<T>.expr(name: String = "", infer: Infer = Infer.Nulls, noinline expression: AddExpression<T, R>): DataColumn<R>

Creates a temporary new column by defining an expression to fill up each row.

See Column Expression for more information.

For more information: See expr on the documentation website.

Check out: Grammar

For example:

df.groupBy{ expr{ firstName.length+ lastName.length} named"nameLength" }

df.sortBy{ expr{ name.length}.desc() }

Parameters

name

The name of the temporary column. Is empty by default ("untitled" in the DataFrame).

infer

org.jetbrains.kotlinx.dataframe.api.Infer.Infer that indicates how DataColumn.type should be calculated. Either None, Nulls, or Type. By default: Nulls.

expression

An AddExpression to define what each new row of the temporary column should contain.