Created
October 23, 2022 18:31
-
-
Save natyrix/1010a1b8156cd5dae5d3777fe358ba6d to your computer and use it in GitHub Desktop.
This file contains 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 characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment