polars selector exclude for expression
Select all columns except those with the given name(s). This is the inverse of `polars selector by-name`.
Signature
> polars selector exclude {flags} ...rest
Parameters
...rest: Column name(s) to exclude from the selection.
Input/output types:
| input | output |
|---|---|
| any | polars_selector |
Examples
Select all columns except 'a' and 'b'
> {
"a": [1.0, 2.0],
"b": [3.0, 4.0],
"c": [5, 6],
} |
polars into-df --as-columns |
polars select (polars selector exclude a b) |
polars collect
╭───┬───╮
│ # │ c │
├───┼───┤
│ 0 │ 5 │
│ 1 │ 6 │
╰───┴───╯Select all columns except 'c'
> [[a b c]; [1 2 3] [4 5 6]]
| polars into-df
| polars select (polars selector exclude c)
| polars collect