polars.field
-
Выбрать поле в текущей области
struct.with_fields.- Параметры:
-
- name
-
Имя поля или полей для выбора.
Примеры
>>> df = pl.DataFrame({"a": [{"x": 5, "y": 2}, {"x": 3, "y": 4}]}) >>> df.select(pl.col("a").struct.with_fields(pl.field("x") ** 2)) shape: (2, 1) ┌───────────┐ │ a │ │ --- │ │ struct[2] │ ╞═══════════╡ │ {25,2} │ │ {9,4} │ └───────────┘
polars.field(
name: str | list[str],
) → Expr
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.field.html