polars math sqrt for dataframe
Compute the element-wise square root of a column expression.
Signature
> polars math sqrt {flags}
Input/output types:
| input | output |
|---|---|
| polars_expression | polars_expression |
| polars_selector | polars_expression |
Examples
Compute the element-wise square root of a column
> [[a]; [0] [1] [4] [9] [16]] | polars into-df | polars select (polars col a | polars math sqrt) | polars collect
╭───┬──────╮
│ # │ a │
├───┼──────┤
│ 0 │ 0.00 │
│ 1 │ 1.00 │
│ 2 │ 2.00 │
│ 3 │ 3.00 │
│ 4 │ 4.00 │
╰───┴──────╯