pyinterp.core.period.PeriodList.belong_to_a_period

pyinterp.core.period.PeriodList.belong_to_a_period#

PeriodList.belong_to_a_period(self, dates: object) → numpy.ndarray[dtype=bool, shape=(*), order='C']#

Test which dates fall within any of the managed periods.

Efficiently checks each input date to determine if it is contained within at least one period in the list. Uses a single-pass algorithm that advances through the periods as dates are processed.

Parameters:

dates – Vector of dates to check (should be sorted for optimal performance).

Returns:

A Boolean vector where true indicates the date is contained in a period.

Note

This is a simple membership test - returns true only if the date falls within [begin, last] of some period. Compare with cross_a_period() which has more complex “look-ahead” semantics.