zeroifnull¶
In [ ]:
zeroifnull(expr)
Evaluates to 0 if the expression is NULL.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
expr | object | ❌ | Expression. |
In [28]:
from verticapy import *
df = tablesample({"x": [0, None, 0.7, None]}).to_vdf()
display(df)
In [29]:
# Importing the stats module
import verticapy.stats as st
# Applying the zeroifnull function
df["zeroifnull_x"] = st.zeroifnull(df["x"])
display(df)
