polars.Expr.tan#
- Expr.tan() Expr[source]#
Compute the element-wise value for the tangent.
- Returns:
- Expr
Expression of data type
Float64.
Notes
The argument must be in radians. To convert from degrees to radians, call
.radians().Examples
>>> from math import pi >>> df = pl.DataFrame({"a": [0.0, pi / 4]}) >>> df.select(pl.col("a").tan()) shape: (2, 1) ┌─────┐ │ a │ │ --- │ │ f64 │ ╞═════╡ │ 0.0 │ │ 1.0 │ └─────┘ >>> df = pl.DataFrame({"a": [0.0, 45]}) >>> df.select(pl.col("a").radians().tan()) shape: (2, 1) ┌─────┐ │ a │ │ --- │ │ f64 │ ╞═════╡ │ 0.0 │ │ 1.0 │ └─────┘