move
Moves the specified columns within the DataFrame.
This function does not immediately move the columns but instead selects columns to move and returns a MoveClause, which serves as an intermediate step. The MoveClause allows specifying the final destination of the selected columns using methods such as to, toStart, toEnd, into, intoIndexed, toTop, after or under, that return a new DataFrame with an updated column structure.
Check out Grammar.
This can include column groups and nested columns.
See Selecting Columns.
For more information: See move on the documentation website.
This Move Overload
Select or express columns using the Columns Selection DSL.
This DSL is initiated by a Columns Selector lambda, which operates in the context of the Columns Selection DSL and expects you to return a SingleColumn or ColumnSet (so, a ColumnsResolver). This is an entity formed by calling any (combination) of the functions in the DSL that is or can be resolved into one or more columns.
The Columns Selection DSL allows using Extension Properties for specifying columns type- and name-safe.
Check out: Columns Selection DSL Grammar
See Column Selectors on the documentation website.
Examples:
df.move { columnA and columnB }.after { columnC }
df.move { cols(0..3) }.under("info")
df.move { colsOf<String>() }.to(5)Parameters
The Columns Selector used to select the columns of this DataFrame to move.
Moves the specified columns within the DataFrame.
This function does not immediately move the columns but instead selects columns to move and returns a MoveClause, which serves as an intermediate step. The MoveClause allows specifying the final destination of the selected columns using methods such as to, toStart, toEnd, into, intoIndexed, toTop, after or under, that return a new DataFrame with an updated column structure.
Check out Grammar.
This can include column groups and nested columns.
See Selecting Columns.
For more information: See move on the documentation website.
This Move Overload
Select single or multiple columns using their names as Strings. (String API).
Examples:
df.move("columnA", "columnB").after("columnC")
df.move("age").under("info")Parameters
The Column Names used to select the columns of this DataFrame to move.
Deprecated
It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html