Skip to content

Select all columns

Description

Select all columns

Usage

cs__all()

Value

A Polars selector

See Also

cs for the documentation on operators supported by Polars selectors.

Examples

library("polars")

df <- pl$DataFrame(dt = as.Date(c("2000-1-1")), value = 10)

# Select all columns, casting them to string:
df$select(cs$all()$cast(pl$String))
#> shape: (1, 2)
#> ┌────────────┬───────┐
#> │ dt         ┆ value │
#> │ ---        ┆ ---   │
#> │ str        ┆ str   │
#> ╞════════════╪═══════╡
#> │ 2000-01-01 ┆ 10.0  │
#> └────────────┴───────┘
# Select all columns except for those matching the given dtypes:
df$select(cs$all() - cs$numeric())
#> shape: (1, 1)
#> ┌────────────┐
#> │ dt         │
#> │ ---        │
#> │ date       │
#> ╞════════════╡
#> │ 2000-01-01 │
#> └────────────┘