Skip to content

Get the first n elements

Source code

Description

This is an alias for <Expr>$head().

Usage

<Expr>$limit(n = 10)

Arguments

n Number of elements to take.

Value

Expr

Examples

library("polars")

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