eelbrain.find_intervals

eelbrain.find_intervals(ndvar, interpolate=False)

Find intervals from a boolean NDVar

Parameters:
ndvar : boolean NDVar (time,)

Data which to convert to intervals.

interpolate : bool

By default, start values reflect the first sample that is True and stop values reflect the first sample that is False. With interpolate=True, time points are shifted half a sample to the left. This is desirable for example when marking regions in a plot.

Returns:
intervals : iterator over tuples

Intervals represented as (start, stop) tuples