Skip to content

Commit ee170d6

Browse files
author
Yuto Akutsu
committed
add cotangent support on PySpark
1 parent c7b7e1d commit ee170d6

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

python/pyspark/sql/functions.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,23 @@ def cosh(col):
377377
return _invoke_function_over_column("cosh", col)
378378

379379

380+
def cot(col):
381+
"""
382+
.. versionadded:: 3.2.0
383+
384+
Parameters
385+
----------
386+
col : :class:`~pyspark.sql.Column` or str
387+
angle in radians
388+
389+
Returns
390+
-------
391+
:class:`~pyspark.sql.Column`
392+
cotangent of the angle.
393+
"""
394+
return _invoke_function_over_column("cot", col)
395+
396+
380397
@since(1.4)
381398
def exp(col):
382399
"""

python/pyspark/sql/functions.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def collect_set(col: ColumnOrName) -> Column: ...
298298
def column(col: str) -> Column: ...
299299
def cos(col: ColumnOrName) -> Column: ...
300300
def cosh(col: ColumnOrName) -> Column: ...
301+
def cot(col: ColumnOrName) -> Column: ...
301302
def count(col: ColumnOrName) -> Column: ...
302303
def cume_dist() -> Column: ...
303304
def degrees(col: ColumnOrName) -> Column: ...

0 commit comments

Comments
 (0)