polars selector string for expression
Select all string columns. Use `--include-categorical` to also select categorical columns.
Signature
> polars selector string {flags}
Flags
--include-categorical, -c: Also include categorical columns in the selection.
Input/output types:
| input | output |
|---|---|
| any | polars_selector |
Examples
Select all string columns
> {
"name": ["Alice", "Bob"],
"age": [30, 25],
"active": [true, false],
} |
polars into-df --as-columns |
polars select (polars selector string) |
polars collect
╭───┬───────╮
│ # │ name │
├───┼───────┤
│ 0 │ Alice │
│ 1 │ Bob │
╰───┴───────╯Create a selector for string and categorical columns
> polars selector string --include-categorical