Determine if a day is a business day in Python / Pandas

后端 未结 6 1681
深忆病人
深忆病人 2021-02-13 23:06

I currently have a program setup to run two different ways. One way is to run over a specified time frame, and the other way is to run everyday. However, when I have it set to r

6条回答
  •  礼貌的吻别
    2021-02-13 23:25

    for me I use an old trick from Excel:

    from pandas.tseries.offsets import Day, BDay
    
    def is_bday(x):
        return x == x + Day(1) - BDay(1)
    

提交回复
热议问题