pyspark.sql.functions.sin

pyspark.sql.functions.sin(col: ColumnOrName) → pyspark.sql.column.Column[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

>>> import math
>>> df = spark.range(1)
>>> df.select(sin(lit(math.radians(90)))).first()
Row(SIN(1.57079...)=1.0)