Skip to content

Compute the square root of the elements

Source code

Description

Compute the square root of the elements

Usage

<Expr>$sqrt()

Value

Expr

Examples

library(polars)

pl$DataFrame(a = -1:3)$with_columns(a_sqrt = pl$col("a")$sqrt())
#> shape: (5, 2)
#> ┌─────┬──────────┐
#> │ a   ┆ a_sqrt   │
#> │ --- ┆ ---      │
#> │ i32 ┆ f64      │
#> ╞═════╪══════════╡
#> │ -1  ┆ NaN      │
#> │ 0   ┆ 0.0      │
#> │ 1   ┆ 1.0      │
#> │ 2   ┆ 1.414214 │
#> │ 3   ┆ 1.732051 │
#> └─────┴──────────┘