atan

atan #

pyspark.sql.functions.atan(col) #

version: since 1.4

Inverse tangent of col, as if computed by java.lang.Math.atan()

atan

Runnable Code:

from pyspark.sql import functions as F
# Set up dataframe
data = [{"num": 1.0},{"num": .5},{"num": 0.0}]
df = spark.createDataFrame(data)
# Use function
df = (df
     .withColumn("atan", F.atan("num"))
     )
df.show()
num atan
1.0 0.7853981633974483
0.5 0.4636476090008061
0.0 0.0

Usage:

This is just a basic math function. Nothing special about it. Never used it.



returns: \_invoke_function_over_column("atan", col)

PySpark manual

tags: atan, tangent, inverse tangent, trigonometry, trig, tan, tanning oil, beach body




© 2023 PySpark Is Rad