explode
Splits list-like values in given columns and spreads them vertically. Values in other columns are duplicated.
explode(dropEmpty = true) [ { columns } ]
Reverse operation: implode
See column selectors for how to select the columns for this operation.
Parameters:
dropEmpty— iftrue, removes rows with empty lists orDataFrameobjects. Otherwise, they will be exploded intonull.
Available for:
DataColumn<Collection>
Exploded columns will change their types:
Exploded FrameColumn will be converted into ColumnGroup.
Explode DataFrame:
val df = dataFrameOf("a", "b")(
    1, listOf(1, 2),
    2, listOf(3, 4),
)
df.explode("b")
When several columns are exploded in one operation, lists in different columns will be aligned.
val a by columnOf(listOf(1, 2), listOf(3, 4, 5))
val b by columnOf(listOf(1, 2, 3), listOf(4, 5))
val df = dataFrameOf(a, b)
df.explode { a and b }
Explode DataColumn<Collection>:
val col by columnOf(listOf(1, 2), listOf(3, 4))
col.explode()
Explode FrameColumn:
val col by columnOf(
    dataFrameOf("a", "b")(1, 2, 3, 4),
    dataFrameOf("a", "b")(5, 6, 7, 8),
)
col.explode()
24 October 2025