round_date¶
In [ ]:
round_date(expr,
precision: str = 'DD')
Rounds the specified date or time.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
expr | object | ❌ | Expression. |
precision | str | ✓ | A string constant that specifies precision for the rounded value, one of the following:
|
In [1]:
from verticapy import *
df = tablesample({"x": ['11/03/1993', '09/05/1959']}).to_vdf()
df["x"].astype("date")
display(df)
In [2]:
# Importing the stats module
import verticapy.stats as st
# Applying the round_date function
df["round_x"] = st.round_date(df["x"], 'MM')
display(df)
