Loading...

verticapy.sql.functions.tan

verticapy.sql.functions.tan(expr: Annotated[str | list[str] | StringSQL | list[StringSQL], '']) StringSQL

Trigonometric Tangent.

Parameters

expr: SQLExpression

Expression.

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": [3.1415, 6, 4.5, 7]})

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

df["tan_x"] = vpf.tan(df["x"])
display(df)
123
x
Numeric(24)
100%
123
tan_x
Float(22)
100%
13.1415-9.26535900581913e-05
26.0-0.291006191384749
34.54.63733205455118
47.00.871447982724319

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.