Two related issues: (1) All of the data I work with have weekday dates attached. At various points, I need to know what the next weekday is. I\'ve written something like the
another way without ifs would be:
def next_wk_day(): date_today = datetime.datetime.today() shift = 1 + ((date_today.weekday()//4)*(6-date_today.weekday())) return(date_today+shift)
which would also work in case you are doing it on a Saturday or Sunday.