polars selector by-name for expression
Creates a selector that selects columns by name.
Signature
> polars selector by-name {flags} ...rest
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 barAdd 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 │
╰───┴────┴───┴────╯