Skip to content

Return the number of elements in the column

Description

Null values are counted in the total.

Usage

<Expr>$len()

Value

A polars expression

Examples

library("polars")

df <- pl$DataFrame(a = 1:3, b = c(NA, 4, 4))
df$select(pl$all()$len())
#> shape: (1, 2)
#> ┌─────┬─────┐
#> │ a   ┆ b   │
#> │ --- ┆ --- │
#> │ u32 ┆ u32 │
#> ╞═════╪═════╡
#> │ 3   ┆ 3   │
#> └─────┴─────┘