Skip to content

temporian.EventSet.notnan #

notnan() -> EventSetOrNode

Returns boolean features, False in the NaN elements of an EventSet.

Equivalent to ~evset.isnan(...).

Note that for int and bool this will always be True since those types don't support NaNs. It only makes actual sense to use on float (or tp.float32) features.

See also evset.isnan().

Example
>>> a = tp.event_set(
...     timestamps=[1, 2, 3],
...     features={"M":[np.nan, 5., np.nan], "N":  [-1, 0, 5]},
... )
>>> b = a.notnan()
>>> b
indexes: ...
        'M': [False True False]
        'N': [ True True True]
...

>>> # Filter only rows where "M" is not nan
>>> a.filter(b["M"])
indexes: ...
        'M': [5.]
        'N': [0]
...

Returns:

Type Description
EventSetOrNode

EventSet with boolean features.