pyspark.sql.functions.sin#

pyspark.sql.functions.sin(col)[source]#

Computes sine of the input column.

New in version 1.4.0.

Changed in version 3.4.0: Supports Spark Connect.

Parameters
colColumn or str

target column to compute on.

Returns
Column

sine of the angle, as if computed by java.lang.Math.sin()

Examples

>>> from pyspark.sql import functions as sf
>>> spark.range(1).select(sf.sin(sf.pi() / 2)).show()
+---------------+
|SIN((PI() / 2))|
+---------------+
|            1.0|
+---------------+