Created
October 23, 2022 18:31
-
-
Save natyrix/1010a1b8156cd5dae5d3777fe358ba6d to your computer and use it in GitHub Desktop.
Revisions
-
natyrix created this gist
Oct 23, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ import holidays class EDAPipeline(): def __init__(self) -> None: self.ng_holidays = holidays.country_holidays('NG') def isHoliday(self, df_date_str): try: dt = datetime.strptime(df_date_str, '%Y-%m-%d %H:%M:%S').date() if dt in self.ng_holidays: return 1 else: return 0 except Exception as e: return 0