Skip to content

temporian.EventSet.after #

after(
    timestamp: Union[int, float, datetime]
) -> EventSetOrNode

Filters events EventSet that happened after a particular timestamp.

The timestamp can be a datetime if the EventSet's timestamps are unix timestamps.

The comparison is strict, meaning that the obtained timestamps would be greater than (>) the provided timestamp.

This operation is equivalent to: input.filter(input.timestamps() < timestamp)

Usage example
>>> a = tp.event_set(
...     timestamps=[0, 1, 5, 6],
...     features={"f1": [0, 10, 50, 60]},
... )

>>> a.after(4)
indexes: []
features: [('f1', int64)]
events:
     (2 events):
        timestamps: [5. 6.]
        'f1': [50 60]
...

>>> from datetime import datetime
>>> a = tp.event_set(
...     timestamps=[datetime(2022, 1, 1), datetime(2022, 1, 2)],
...     features={"f1": [1, 2]},
... )

>>> a.after(datetime(2022, 1, 1, 12))
indexes: []
features: [('f1', int64)]
events:
     (1 events):
        timestamps: ['2022-01-02T00:00:00']
        'f1': [2]
...

Parameters:

Name Type Description Default
timestamp Union[int, float, datetime]

EventSet with a single boolean feature.

required

Returns:

Type Description
EventSetOrNode

Filtered EventSet.