Spec-Zone.ru › Nushell

polars selector last for expression

Creates a selector that selects the last column(s) by index.

Signature

> polars selector last {flags} (n)

Parameters

  • n: Number of columns to select from the end (default: 1).

Input/output types:

input output
any polars_selector

Examples

Create a selector for the last column

> polars selector last

Create a selector for the last 3 columns

> polars selector last 3

Create a new column from the last column using with-column

> [[a b c]; [1 2 3] [4 5 6]]
                    | polars into-df
                    | polars with-column ((polars selector last) * 100 | polars as c_times_100)
                    | polars collect
╭───┬───┬───┬───┬─────────────╮
│ # │ a │ b │ c │ c_times_100 │
├───┼───┼───┼───┼─────────────┤
│ 0 │ 1 │ 2 │ 3 │         300 │
│ 1 │ 4 │ 5 │ 6 │         600 │
╰───┴───┴───┴───┴─────────────╯

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

Spec-Zone.ru

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