Skip to content

Commit 35fd6de

Browse files
committed
.
1 parent 1bd0c6c commit 35fd6de

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

engineering.rst

+7
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ Here's a script to pull those values out.
3232
df['dayofweek'] = df['timestamp'].dt.dayofweek
3333
return df
3434
35+
To get holidays, use the package ``holidays``
36+
37+
.. code:: python
38+
39+
import holidays
40+
train['holiday'] = train['timestamp'].apply(lambda x: 0 if holidays.US().get(x) is None else 1)
41+
3542
Time-Series
3643
^^^^^^^^^^^^^^
3744
Decomposing a time-series into trend (long-term), seaonality (short-term), residuals (noise).

0 commit comments

Comments
 (0)