Skip to content

Get the standard deviation.

Source code

Description

This function is syntactic sugar for pl$col(…)$std(ddof).

Usage

pl$std(..., ddof = 1)

Arguments

Characters indicating the column names, passed to pl$col(). See ?pl_col for details.
ddof An integer representing "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.

Value

Expr

See Also

  • \$std()

Examples

library("polars")

df = pl$DataFrame(
  a = c(1, 8, 3),
  b = c(4, 5, 2),
  c = c("foo", "bar", "foo")
)

df$select(pl$std("a"))
#> shape: (1, 1)
#> ┌──────────┐
#> │ a        │
#> │ ---      │
#> │ f64      │
#> ╞══════════╡
#> │ 3.605551 │
#> └──────────┘
df$select(pl$std(c("a", "b")))
#> shape: (1, 2)
#> ┌──────────┬──────────┐
#> │ a        ┆ b        │
#> │ ---      ┆ ---      │
#> │ f64      ┆ f64      │
#> ╞══════════╪══════════╡
#> │ 3.605551 ┆ 1.527525 │
#> └──────────┴──────────┘