Spec-Zone.ru › Polars

polars.Expr.rechunk

Expr.rechunk() → Expr

Создать единый блок памяти для этой Series.

Примеры

>>> df = pl.DataFrame({"a": [1, 1, 2]})

Создать Series с 3 значениями null, добавить столбец a, затем выполнить перегруппировку.

>>> df.select(pl.repeat(None, 3).append(pl.col("a")).rechunk())
shape: (6, 1)
┌────────┐
│ repeat │
│ ---    │
│ i64    │
╞════════╡
│ null   │
│ null   │
│ null   │
│ 1      │
│ 1      │
│ 2      │
└────────┘

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.rechunk.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API