polars.Expr.name.prefix
-
Добавляет префикс к имени корневого столбца выражения.
- Параметры:
-
- prefix
-
Префикс, добавляемый к имени корневого столбца.
Примеры
>>> df = pl.DataFrame( ... { ... "a": [1, 2, 3], ... "b": ["x", "y", "z"], ... } ... ) >>> df.with_columns(pl.all().reverse().name.prefix("reverse_")) shape: (3, 4) ┌─────┬─────┬───────────┬───────────┐ │ a ┆ b ┆ reverse_a ┆ reverse_b │ │ --- ┆ --- ┆ --- ┆ --- │ │ i64 ┆ str ┆ i64 ┆ str │ ╞═════╪═════╪═══════════╪═══════════╡ │ 1 ┆ x ┆ 3 ┆ z │ │ 2 ┆ y ┆ 2 ┆ y │ │ 3 ┆ z ┆ 1 ┆ x │ └─────┴─────┴───────────┴───────────┘
Expr.name.prefix(
prefix: str,
) → Expr
© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.name.prefix.html