Skip to content

Get mean value

Source code

Description

Get mean value

Usage

<Expr>$mean()

Value

Expr

Examples

library("polars")

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