overlaps¶
In [ ]:
overlaps(start0, end0, start1, end1)
Evaluates two time periods and returns true when they overlap, false otherwise.
Parameters¶
| Name | Type | Optional | Description |
|---|---|---|---|
start0 | object | ❌ | DATE, TIME, or TIMESTAMP/TIMESTAMPTZ value that specifies the beginning of a time period. |
end0 | object | ❌ | DATE, TIME, or TIMESTAMP/TIMESTAMPTZ value that specifies the end of a time period. |
start1 | object | ❌ | DATE, TIME, or TIMESTAMP/TIMESTAMPTZ value that specifies the beginning of a time period. |
end1 | object | ❌ | DATE, TIME, or TIMESTAMP/TIMESTAMPTZ value that specifies the end of a time period. |
In [1]:
from verticapy import *
df = tablesample({"start0": ['11-03-1993'],
"end0": ['12-03-1993'],
"start1": ['11-30-1993'],
"end1": ['11-30-1994']}).to_vdf()
df["start0"].astype("timestamp")
df["start1"].astype("timestamp")
df["end0"].astype("timestamp")
df["end1"].astype("timestamp")
display(df)
In [2]:
# Importing the stats module
import verticapy.stats as st
# Applying the overlaps function
df["overlaps"] = st.overlaps(df["start0"], df["end0"], df["start1"], df["end1"])
display(df)
