Spec-Zone.ru › Polars

polars.Expr.cot

Expr.cot() → Expr

Compute the element-wise value for the cotangent.

engine:In MemoryStreamingDistributed
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").cot())
shape: (2, 1)
┌─────┐
│ a   │
│ --- │
│ f64 │
╞═════╡
│ inf │
│ 1.0 │
└─────┘
>>> df = pl.DataFrame({"a": [0.0, 45]})
>>> df.select(pl.col("a").radians().cot())
shape: (2, 1)
┌─────┐
│ a   │
│ --- │
│ f64 │
╞═════╡
│ inf │
│ 1.0 │
└─────┘

© 2020 Ritchie Vink
© 2022 Polars contributors
Licensed under the MIT License.
https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.cot.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API