Skip to content

Aggregate the columns of this DataFrame to their standard deviation values

Description

Aggregate the columns of this DataFrame to their standard deviation values

Usage

<DataFrame>$std(ddof = 1)

Arguments

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.

Value

A polars DataFrame

Examples

library("polars")

df <- pl$DataFrame(a = 1:4, b = c(1, 2, 1, 1))
df$std()
#> shape: (1, 2)
#> ┌──────────┬─────┐
#> │ a        ┆ b   │
#> │ ---      ┆ --- │
#> │ f64      ┆ f64 │
#> ╞══════════╪═════╡
#> │ 1.290994 ┆ 0.5 │
#> └──────────┴─────┘
df$std(ddof = 0)
#> shape: (1, 2)
#> ┌──────────┬──────────┐
#> │ a        ┆ b        │
#> │ ---      ┆ ---      │
#> │ f64      ┆ f64      │
#> ╞══════════╪══════════╡
#> │ 1.118034 ┆ 0.433013 │
#> └──────────┴──────────┘