Skip to content

curvefit.core.utils.sizes_to_indices

Converting sizes to corresponding indices.

Syntax

indices = curvefit.sizes_to_indices(sizes)

Arguments

  • sizes (iterable): The argument sizes is an iterable object with integer values. The i-th value in sizes[i] is the number of elements in the i-th subvector of a larger total vector that contains the subvectors in order.

Returns

  • indices: The return value indices is a list of one dimensional numpy arrays. The value indices[i] has length equal to the i-th size. It starts (ends) with the index in the total vector of the first (last) element of the i-th subvector. The elements of indices[i] are monotone and increase by one between elements.

Example

sizes_to_indices_xam