Skip to content

Select columns from this DataFrame

Description

This will run all expression sequentially instead of in parallel. Use this when the work per expression is cheap.

Usage

<DataFrame>$select_seq(...)

Arguments

\<dynamic-dots\> Name-value pairs of objects to be converted to polars expressions by the as_polars_expr() function. Characters are parsed as column names, other non-expression inputs are parsed as literals. Each name will be used as the expression name.

Value

A polars DataFrame

Examples

library("polars")

df <- pl$DataFrame(
  foo = 1:3,
  bar = 6:8,
  ham = letters[1:3]
)
df$select_seq("foo", bar2 = pl$col("bar") * 2)
#> shape: (3, 2)
#> ┌─────┬──────┐
#> │ foo ┆ bar2 │
#> │ --- ┆ ---  │
#> │ i32 ┆ f64  │
#> ╞═════╪══════╡
#> │ 1   ┆ 12.0 │
#> │ 2   ┆ 14.0 │
#> │ 3   ┆ 16.0 │
#> └─────┴──────┘