coalesce¶
In [ ]:
coalesce(expr, *argv)
Returns the value of the first non-null expression in the list.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
expr | object | ❌ | Expression. |
argv | object | ❌ | Infinite Number of Expressions. |
In [71]:
from verticapy import *
df = tablesample({"x": [0.8, -1, None, -2, None]}).to_vdf()
display(df)
In [72]:
# Importing the stats module
import verticapy.stats as st
# Applying the coalesce function
df["coalesce_x"] = st.coalesce(df["x"], 666)
display(df)
