Skip to content

Returns a column with a separate row for every list element

Source code

Description

Returns a column with a separate row for every list element

Usage

<Expr>$list$explode()

Value

Expr

Examples

library("polars")

df = pl$DataFrame(a = list(c(1, 2, 3), c(4, 5, 6)))
df$select(pl$col("a")$list$explode())
#> shape: (6, 1)
#> ┌─────┐
#> │ a   │
#> │ --- │
#> │ f64 │
#> ╞═════╡
#> │ 1.0 │
#> │ 2.0 │
#> │ 3.0 │
#> │ 4.0 │
#> │ 5.0 │
#> │ 6.0 │
#> └─────┘