ungroup

fun <T, C> DataFrame<T>.ungroup(columns: ColumnsSelector<T, C>): DataFrame<T>

Ungroups the specified column groups within the DataFrame, i.e., replaces each ColumnGroup with its nested columns.

This can include nested column groups.

See Selecting Columns.

For more information: See ungroup on the documentation website.

Reverse operation: group.

This Ungroup 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:

// Ungroups "groupA" and "groupB" column groups
df.ungroup { groupA and groupB }
// Ungroups all column groups at any depth which name contains "group" substring
df.ungroup { colsAtAnyDepth().colGroups { it.name().contains("group") } }

Return

A new DataFrame with ungrouped columns.

Parameters

columns

The Columns Selector used to select the column groups of this DataFrame to ungroup.

Throws

if the specified columns are not a ColumnGroup.


fun <T> DataFrame<T>.ungroup(vararg columns: String): DataFrame<T>

Ungroups the specified column groups within the DataFrame, i.e., replaces each ColumnGroup with its nested columns.

This can include nested column groups.

See Selecting Columns.

For more information: See ungroup on the documentation website.

Reverse operation: group.

This Ungroup Overload

Select single or multiple columns using their names as Strings. (String API).

For example:

df.ungroup("length", "age")

Return

A new DataFrame with ungrouped columns.

Parameters

columns

The Column Names used to select the columns of this DataFrame to ungroup.

Throws

if the specified columns are not a ColumnGroup.


fun <T> DataFrame<T>.ungroup(vararg columns: ColumnReference<*>): DataFrame<T>
fun <T> DataFrame<T>.ungroup(vararg columns: KProperty<*>): DataFrame<T>

Deprecated

It's recommended to migrate to the String or Extension Properties Access API https://kotlin.github.io/dataframe/apilevels.html