temporian.EventSet.resample #
resample(sampling: EventSetOrNode) -> EventSetOrNode
Resamples an EventSet
at each timestamp of
another EventSet
.
If a timestamp in sampling
does not have a corresponding timestamp in
the input, the last timestamp in the input is used instead. If this timestamp
is anterior to an value in the input, the value is replaced by
dtype.MissingValue(...)
.
Example
>>> a = tp.event_set(
... timestamps=[1, 5, 8, 9],
... features={"f1": [1.0, 2.0, 3.0, 4.0]}
... )
>>> b = tp.event_set(timestamps=[-1, 1, 6, 10])
>>> c = a.resample(b)
>>> c
indexes: ...
timestamps: [-1. 1. 6. 10.]
'f1': [nan 1. 2. 4.]
...
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sampling |
EventSetOrNode
|
EventSet to use the sampling of. |
required |
Returns:
Type | Description |
---|---|
EventSetOrNode
|
Resampled EventSet, with same sampling as |