Skip to content

Get the first value.

Source code

Description

Get the first value.

Usage

<Expr>$first()

Value

Expr

Examples

library("polars")

pl$DataFrame(x = 3:1)$with_columns(first = pl$col("x")$first())
#> shape: (3, 2)
#> ┌─────┬───────┐
#> │ x   ┆ first │
#> │ --- ┆ ---   │
#> │ i32 ┆ i32   │
#> ╞═════╪═══════╡
#> │ 3   ┆ 3     │
#> │ 2   ┆ 3     │
#> │ 1   ┆ 3     │
#> └─────┴───────┘