polars.Series.explode
-
Развернуть Series со списками.
Это означает, что каждый элемент преобразуется в новую строку.
- Параметры:
-
- empty_as_null
-
Развернуть пустой список в
null. - keep_nulls
-
Развернуть список
nullвnull.
- Возвращает:
-
- Series
-
Series с типом данных элементов списка.
См. также
-
Series.list.explode -
Развернуть столбец со списками.
Примеры
>>> s = pl.Series("a", [[1, 2, 3], [4, 5, 6]]) >>> s shape: (2,) Series: 'a' [list[i64]] [ [1, 2, 3] [4, 5, 6] ] >>> s.explode(empty_as_null=False) shape: (6,) Series: 'a' [i64] [ 1 2 3 4 5 6 ]
Series.explode(
*,
empty_as_null: bool | None = True,
keep_nulls: bool = True,
) → Series
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/series/api/polars.Series.explode.html