Skip to content

temporian.EventSet.filter_moving_count #

filter_moving_count(
    window_length: Duration,
) -> EventSetOrNode

Filters out events such that no more than one output event is within a tailing time window of window_length.

Filtering is applied in chronological order: An event received at time t is filtered out if there is a non-filtered out event in (t-window_length, t].

This operator is different from (evtset.moving_count(window_length) == 0).filter(). In filter_moving_count a filtered event does not block following events.

Usage example
>>> a = tp.event_set(timestamps=[1, 2, 3])
>>> b = a.filter_moving_count(window_length=1.5)
>>> b
indexes: []
features: []
events:
     (2 events):
        timestamps: [1. 3.]
...

Returns:

Type Description
EventSetOrNode

EventSet without features with the filtered events.