polars.avg#
- polars.avg(column: str) Expr [source]#
- polars.avg(column: Series) float
Alias for mean.
Deprecated since version 0.18.12: Use
mean
instead.Examples
>>> df = pl.DataFrame({"a": [1, 8, 3], "b": [4, 5, 2], "c": ["foo", "bar", "foo"]}) >>> df.select(pl.avg("a")) shape: (1, 1) ┌─────┐ │ a │ │ --- │ │ f64 │ ╞═════╡ │ 4.0 │ └─────┘