polars.Series.arr.explode#
- Series.arr.explode(*, empty_as_null: bool = True, keep_nulls: bool = True) Series[source]#
Returns a column with a separate row for every array element.
- Parameters:
- empty_as_null
Explode an empty array into a
null.- keep_nulls
Explode a
nullarray into anull.
- Returns:
- Series
Series with the data type of the array elements.
Examples
>>> s = pl.Series("a", [[1, 2, 3], [4, 5, 6]], dtype=pl.Array(pl.Int64, 3)) >>> s.arr.explode() shape: (6,) Series: 'a' [i64] [ 1 2 3 4 5 6 ]