Spec-Zone.ru › Nushell

polars selector by-name for expression

Creates a selector that selects columns by name.

Signature

> polars selector by-name {flags} ...rest

Flags

  • --strict: If set, the selector will error if any specified column names do not exist.

Parameters

  • ...rest: Names of columns to select.

Input/output types:

input output
any polars_selector

Examples

Create a selector for columns by name

> polars selector by-name foo bar

Add 10 to specific columns using with-column

> [[a b c]; [1 2 3] [4 5 6]]
                    | polars into-df
                    | polars with-column ((polars selector by-name a c) + 10)
                    | polars collect
╭───┬────┬───┬────╮
│ # │ a  │ b │ c  │
├───┼────┼───┼────┤
│ 0 │ 11 │ 2 │ 13 │
│ 1 │ 14 │ 5 │ 16 │
╰───┴────┴───┴────╯

Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/polars_selector_by-name.html

Spec-Zone.ru

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