Spec-Zone.ru › Nushell

polars selector digit for expression

Select columns whose names consist entirely of digit characters. By default uses Unicode decimal digits; use `--ascii-only` to restrict to ASCII 0-9.

Signature

> polars selector digit {flags}

Flags

  • --ascii-only, -a: Restrict to ASCII digit characters (0-9) only.

Input/output types:

input output
any polars_selector

Examples

Select columns whose names consist entirely of digits

> {
    "123": [1, 2],
    "abc": [3, 4],
    "4": [5, 6],
} |
polars into-df --as-columns |
polars select (polars selector digit) |
polars sort-by "123" "4" |
polars collect
╭───┬─────┬───╮
│ # │ 123 │ 4 │
├───┼─────┼───┤
│ 0 │   1 │ 5 │
│ 1 │   2 │ 6 │
╰───┴─────┴───╯

Select digit-named columns using ASCII digits only

> {
    "123": [1, 2],
    "abc": [3, 4],
} |
polars into-df --as-columns |
polars select (polars selector digit --ascii-only) |
polars collect
╭───┬─────╮
│ # │ 123 │
├───┼─────┤
│ 0 │   1 │
│ 1 │   2 │
╰───┴─────╯

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

Spec-Zone.ru

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