MCPcopy Create free account
hub / github.com/numpy/numpy / get_day_of_week

Function get_day_of_week

numpy/core/src/multiarray/datetime_busday.c:27–39  ·  view source on GitHub ↗

Gets the day of the week for a datetime64[D] value */

Source from the content-addressed store, hash-verified

25
26/* Gets the day of the week for a datetime64[D] value */
27static int
28get_day_of_week(npy_datetime date)
29{
30 int day_of_week;
31
32 /* Get the day of the week for 'date' (1970-01-05 is Monday) */
33 day_of_week = (int)((date - 4) % 7);
34 if (day_of_week < 0) {
35 day_of_week += 7;
36 }
37
38 return day_of_week;
39}
40
41/*
42 * Returns 1 if the date is a holiday (contained in the sorted

Callers 3

apply_business_day_rollFunction · 0.85
apply_business_day_countFunction · 0.85
is_business_dayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected