py_eddy_tracker.generic.build_index

py_eddy_tracker.generic.build_index(groups)[source]

We expect that variable is monotonous, and return index for each step change.

Parameters:

groups (array) – array that contains groups to be separated

Returns:

(first_index of each group, last_index of each group, value to shift groups)

Return type:

(array, array, int)

Example:

>>> build_index(array((1, 1, 3, 4, 4)))
(array([0, 2, 2, 3]), array([2, 2, 3, 5]), 1)