toTop

fun <T, C> MoveClause<T, C>.toTop(newColumnName: ColumnsSelectionDsl<T>.(ColumnWithPath<C>) -> String = { it.name() }): DataFrame<T>

Moves columns, previously selected with move to the top-level within the DataFrame. Moved columns name can be specified via special ColumnSelectionDsl.

Returns a new DataFrame with updated columns.

See Selecting Columns.

For more information: See move on the documentation website.

Examples:

df.move { info.age and info.weight }.toTop()
df.move { colsAtAnyDepth { it.name() == "number" } }.toTop { it.parentName + it.name() }

Parameters

newColumnName

The special ColumnsSelector for defining the name of the moved column. Optional, the original name is used by default