Created
October 23, 2022 18:24
-
-
Save natyrix/36dab764077afd9b60eaa9d00f045d26 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
def isWeekend(self, df_date_str): | |
# 2021-07-01 07:28:04 | |
datetime_object = datetime.strptime(df_date_str, '%Y-%m-%d %H:%M:%S') | |
# print(datetime_object.weekday()) | |
if datetime_object.weekday() < 5: | |
return 0 | |
else: # 5 Sat, 6 Sun | |
return 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment