ktk.TimeSeries.isnan

ktk.TimeSeries.isnan#

TimeSeries.isnan(data_key)[source]#

Return a boolean array of missing samples.

Parameters:

data_key (str) – Key value of the data signal to analyze.

Returns:

A boolean array of the same size as the time attribute, where True values represent missing samples (samples that contain at least one nan value).

Return type:

np.ndarray

Example

>>> ts = ktk.TimeSeries(time=np.arange(4))
>>> ts = ts.add_data("data", np.zeros((4, 2)))
>>> ts.data["data"][2, :] = np.nan
>>> ts.data
{'data': array([[ 0.,  0.], [ 0.,  0.], [nan, nan], [ 0.,  0.]])}
>>> ts.isnan("data")
array([False, False,  True, False])