Skip to content

Get the last n elements

Source code

Description

Get the last n elements

Usage

<Expr>$tail(n = 10)

Arguments

n Number of elements to take.

Value

Expr

Examples

library("polars")

pl$DataFrame(x = 1:11)$select(pl$col("x")$tail(3))
#> shape: (3, 1)
#> ┌─────┐
#> │ x   │
#> │ --- │
#> │ i32 │
#> ╞═════╡
#> │ 9   │
#> │ 10  │
#> │ 11  │
#> └─────┘