date

In [ ]:
date(expr)

Converts the input value to a DATE data type.

Parameters

Name Type Optional Description
expr
object
❌
Expression.

Returns

str_sql : SQL expression.

Example

In [24]:
from verticapy import *
df = tablesample({"x": ['11-03-1993 12:05:10.23', '09-05-1959 03:10:20.12']}).to_vdf()
display(df)
Abc
x
Varchar(22)
111-03-1993 12:05:10.23
209-05-1959 03:10:20.12
Rows: 1-2 | Column: x | Type: varchar(22)
In [25]:
# Importing the stats module
import verticapy.stats as st

# Applying the date function
df["date_x"] = st.date(df["x"])
display(df)
Abc
x
Varchar(22)
📅
date_x
Date
111-03-1993 12:05:10.231993-11-03
209-05-1959 03:10:20.121959-09-05
Rows: 1-2 | Columns: 2