Dataframe
 
1.0

flatten

Edit pageLast modified: 24 July 2025

Returns DataFrame without column groupings under selected columns.

Columns will keep their original names after flattening. Potential column name clashes are resolved by adding minimal possible name prefix from ancestor columns.

Related operations: Group / ungroup / flatten columns

See column selectors for how to select the columns for this operation.

// name.firstName -> firstName
// name.lastName -> lastName
df.flatten { name }

To remove all column groupings in DataFrame, invoke flatten without parameters: