Loading...

verticapy.sql.functions.atan2#

verticapy.sql.functions.atan2(quotient: str | list[str] | StringSQL | list[StringSQL], divisor: str | list[str] | StringSQL | list[StringSQL]) StringSQL#

Trigonometric Inverse Tangent of the arithmetic dividend of the arguments.

Parameters#

quotient: SQLExpression

Expression representing the quotient.

divisor: SQLExpression

Expression representing the divisor.

Returns#

StringSQL

SQL string.

Examples#

First, let’s import the vDataFrame in order to create a dummy dataset.

from verticapy import vDataFrame

Now, let’s import the VerticaPy SQL functions.

import verticapy.sql.functions as vpf

We can now build a dummy dataset.

df = vDataFrame(
    {
        "x": [0, -1, 0.7, 0.5],
        "y": [2, 5, 1, 3],
    },
)

Now, let’s go ahead and apply the function.

df["atan2_x"] = vpf.atan2(df["x"], df["y"])
display(df)
123
x
Numeric(21)
100%
...
123
y
Integer
100%
123
atan2_x
Float(22)
100%
10.0...20.0
2-1.0...5-0.197395559849881
30.7...10.610725964389209
40.5...30.165148677414627

Note

It’s crucial to utilize VerticaPy SQL functions in coding, as they can be updated over time with new syntax. While SQL functions typically remain stable, they may vary across platforms or versions. VerticaPy effectively manages these changes, a task not achievable with pure SQL.

See also

vDataFrame.eval() : Evaluates the expression.