polars.Expr.list.std#

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

Compute the std value of the lists in the array.

Parameters:
ddof

“Delta Degrees of Freedom”: the divisor used in the calculation is N - ddof, where N represents the number of elements. By default ddof is 1.

Examples

>>> df = pl.DataFrame({"values": [[-1, 0, 1], [1, 10]]})
>>> df.with_columns(pl.col("values").list.std().alias("std"))
shape: (2, 2)
┌────────────┬──────────┐
│ values     ┆ std      │
│ ---        ┆ ---      │
│ list[i64]  ┆ f64      │
╞════════════╪══════════╡
│ [-1, 0, 1] ┆ 1.0      │
│ [1, 10]    ┆ 6.363961 │
└────────────┴──────────┘