PeriodUnit
Source¶
Bases: Enum
Lengths of the periods DatePeriod groups dates by, such as the month or the week.
Added in version 0.1.0
Examples:
from datetime import datetime
import numdaplot as ndp
times = ndp.Array.from_list([datetime(2026, 12, 31, 14, 30)])
times.apply(ndp.DatePeriod(unit=ndp.PeriodUnit.MONTH))
# Array(['2026-12-01'], dtype=DATE)
Attributes¶
QUARTER = auto()
Source¶
The quarter, starting on January 1, April 1, July 1 or October 1.
Added in version 0.1.0
Examples: