temporian.EventSet.isnan #
isnan() -> EventSetOrNode
Returns boolean features, True in the NaN elements of the
EventSet.
Note that for int and bool this will always be False since those types
don't support NaNs. It only makes actual sense to use on float (or
tp.float32) features.
See also evset.notnan().
Example
>>> a = tp.event_set(
... timestamps=[1, 2, 3],
... features={"M":[np.nan, 5., np.nan], "N": [-1, 0, 5]},
... )
>>> b = a.isnan()
>>> b
indexes: ...
'M': [ True False True]
'N': [False False False]
...
>>> # Count nans
>>> b["M"].cast(int).cumsum()
indexes: ...
timestamps: [1. 2. 3.]
'M': [1 1 2]
...
Returns:
| Type | Description |
|---|---|
EventSetOrNode
|
EventSet with boolean features. |