polars.Expr.arctan#

Expr.arctan() Expr[source]#

Compute the element-wise value for the inverse tangent.

Returns:
Expr

Expression of data type Float64, measuring an angle in radians.

Notes

To convert the result from radians to degrees, call .degrees().

Examples

>>> df = pl.DataFrame({"a": [float("Inf"), 1, 0]})
>>> df.select(pl.col("a").arctan())
shape: (3, 1)
┌──────────┐
│ a        │
│ ---      │
│ f64      │
╞══════════╡
│ 1.570796 │
│ 0.785398 │
│ 0.0      │
└──────────┘
>>> df.select(pl.col("a").arctan().degrees())
shape: (3, 1)
┌──────┐
│ a    │
│ ---  │
│ f64  │
╞══════╡
│ 90.0 │
│ 45.0 │
│ 0.0  │
└──────┘