pymovements.gaze.transforms_numpy.consecutive#

pymovements.gaze.transforms_numpy.consecutive(arr: ndarray) list[ndarray]#

Split array into groups of consecutive numbers.

Parameters:

arr (np.ndarray) – Array to be split into groups of consecutive numbers.

Returns:

List of arrays with consecutive numbers.

Return type:

list[np.ndarray]

Example

>>> arr = np.array([0, 47, 48, 49, 50, 97, 98, 99])
>>> consecutive(arr)
[array([0]), array([47, 48, 49, 50]), array([97, 98, 99])]