yasa.get_bool_vector

yasa.get_bool_vector(data=None, sf=None, detection=None)[source]

Return a Boolean vector given the original data and sf and a YASA’s detection dataframe.

Parameters
dataarray_like or mne.io.BaseRaw

1D or 2D EEG data. Can also be mne.io.BaseRaw, in which case data and sf will be automatically extracted.

sffloat

The sampling frequency of data. Can be omitted if data is a mne.io.BaseRaw.

detectionpandas.DataFrame

YASA’s detection dataframe returned by the yasa.spindles_detect(), yasa.sw_detect(), or yasa.rem_detect() functions.

Returns
bool_vectornumpy.ndarray

Array of bool indicating for each sample in data if this sample is part of a detected event (True) or not (False).