polars.Expr.var#

Expr.var(ddof: int = 1) Expr[source]#

Get variance.

Parameters:
ddof

Degrees of freedom.

Examples

>>> df = pl.DataFrame({"a": [-1, 0, 1]})
>>> df.select(pl.col("a").var())
shape: (1, 1)
┌─────┐
│ a   │
│ --- │
│ f64 │
╞═════╡
│ 1.0 │
└─────┘