-
Notifications
You must be signed in to change notification settings - Fork 0
/
dates.py
48 lines (36 loc) · 1.11 KB
/
dates.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import datetime
import findspark
findspark.init()
from pyspark.sql import DataFrame
def is_belgian_holiday(date: datetime.date) -> bool:
pass
def label_weekend(
df: DataFrame, colname: str = "date", new_colname: str = "is_weekend"
) -> DataFrame:
"""Adds a column indicating whether or not the attribute `colname`
in the corresponding row is a weekend day."""
pass
def label_holidays(
df: DataFrame,
colname: str = "date",
new_colname: str = "is_belgian_holiday",
) -> DataFrame:
"""Adds a column indicating whether or not the column `colname`
is a holiday."""
pass
def label_holidays2(
df: DataFrame,
colname: str = "date",
new_colname: str = "is_belgian_holiday",
) -> DataFrame:
"""Adds a column indicating whether or not the column `colname`
is a holiday. An alternative implementation."""
pass
def label_holidays3(
df: DataFrame,
colname: str = "date",
new_colname: str = "is_belgian_holiday",
) -> DataFrame:
"""Adds a column indicating whether or not the column `colname`
is a holiday. An alternative implementation."""
pass