apply¶
In [ ]:
apply(func: str,
*args,
**kwargs)
Applies any Vertica function on the input expressions. For a list of available functions, see the Vertica documentation.
Parameters¶
Name | Type | Optional | Description |
---|---|---|---|
func | str | ❌ | The name of a Vertica function. For geospatial functions, the ST_ or STV_ prefixes can be omitted. |
args | object | ✓ | Expressions. |
kwargs | object | ✓ | Optional Parameters Expressions. |
In [9]:
from verticapy import *
df = tablesample({"x": [11.4, -2.5, 3.5, -4.2]}).to_vdf()
display(df)
In [10]:
# Importing the stats module
import verticapy.stats as st
# Applying the avg function
df["avg_x"] = st.apply("avg", df["x"])._over()
display(df)