polars.Expr.arr.mean#

Expr.arr.mean() Expr[source]#

Compute the mean value of the lists in the array.

Examples

>>> df = pl.DataFrame({"values": [[1], [2, 3]]})
>>> df.select(pl.col("values").arr.mean())
shape: (2, 1)
┌────────┐
│ values │
│ ---    │
│ f64    │
╞════════╡
│ 1.0    │
│ 2.5    │
└────────┘