Date and Period Utilities

Date and Period Utilities#

Vectorized helpers for numpy.datetime64 arrays and time periods. The pyinterp.dateutils functions decompose dates without converting them to datetime objects, and Period / PeriodList represent time intervals and collections of them; both modules are available as pyinterp.dateutils and pyinterp.period.

Date Utilities#

date(array)

Extract the date part (year, month, day) from a numpy datetime64 array.

time(array)

Extract the time part (hour, minute, second) from a numpy datetime64 array.

weekday(array)

Return the day of the week as an integer, where Monday is 0 and Sunday is 6.

isocalendar(array)

Extract the ISO calendar date (year, week number, weekday) from a numpy datetime64 array.

timedelta_since_january(array)

Return the timedelta since the first day of the year.

Periods#

Period(self, begin, end[, within])

A Period.

PeriodList()

A list of Period objects.