Created
October 23, 2022 18:24
-
-
Save natyrix/36dab764077afd9b60eaa9d00f045d26 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,8 @@ 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