原文:https://docs.scipy.org/doc/numpy/reference/generated/numpy.is_busday.html
校对:(虚位以待)
numpy.
is_busday
(dates, weekmask='1111100', holidays=None, busdaycal=None, out=None)计算哪些给定日期是有效日期,哪些日期不是。
版本1.7.0中的新功能。
参数: | 日期:array_like of datetime64 [D]
weekmask:str或array_like of bool,可选
节假日:array_like of datetime64 [D],可选
busdaycal:busdaycalendar,可选
out:bool的数组,可选
|
---|---|
返回: | out:bool的数组
|
也可以看看
busdaycalendar
busday_offset
busday_count
例子
>>> # The weekdays are Friday, Saturday, and Monday
... np.is_busday(['2011-07-01', '2011-07-02', '2011-07-18'],
... holidays=['2011-07-01', '2011-07-04', '2011-07-17'])
array([False, False, True], dtype='bool')