DatePartUnit
Source¶
Bases: Enum
Parts of a date that DatePart reads, such as its month or its day of 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, 15)])
times.apply(ndp.DatePart(unit=ndp.DatePartUnit.MONTH))
# Array([12.], dtype=FLOAT64)
Attributes¶
QUARTER = auto()
Source¶
The quarter of the year, from 1 for January to March to 4 for October to December.
Added in version 0.1.0
Examples:
WEEK = auto()
Source¶
The ISO week number, from 1 to 53. Week 1 holds the first Thursday of the year.
Added in version 0.1.0
Examples: