To allow a datetime to be used in contexts where only certain days of the week are valid, NumPy includes a set of business day functions.
Weekmask
is used to customize valid business days.
Weekmask
can be specified in several formats:
- As an array of 7
1
or 0
values, e.g. [1, 1, 1, 1, 1, 0, 0]
- As a string of 7
1
or 0
characters, e.g. "1111100"
- As a string with abbreviations of valid days from this list:
Mon Tue Wed Thu Fri Sat Sun
, e.g. "Mon Tue Wed Thu Fri"
Setting an incorrect weekmask
leads to ValueError
.