day

In [ ]:
day(expr)

Returns as an integer the day of the month from the input expression.

Parameters

Name Type Optional Description
expr
object
❌
Expression.

Returns

str_sql : SQL expression.

Example

In [1]:
from verticapy import *
df = tablesample({"x": ['11-03-1993 12:00:00', '09-05-1959 03:00:00']}).to_vdf()
df["x"].astype("timestamp")
display(df)
📅
x
Timestamp
11993-11-03 12:00:00
21959-09-05 03:00:00
Rows: 1-2 | Column: x | Type: timestamp
In [2]:
# Importing the stats module
import verticapy.stats as st

# Applying the day function
df["day_x"] = st.day(df["x"])
display(df)
📅
x
Timestamp
123
day_x
Integer
11993-11-03 12:00:003
21959-09-05 03:00:005
Rows: 1-2 | Columns: 2