Skip to content

Get the number of non-null elements in the column

Description

Get the number of non-null elements in the column

Usage

<Expr>$count()

Value

A polars expression

Examples

library("polars")

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