skactiveml.utils.check_indices#

skactiveml.utils.check_indices(indices, A, dim='adaptive', unique=True)[source]#

Check if indices fit to array.

Parameters
indicesarray-like of shape (n_indices, n_dim) or (n_indices,)

The considered indices, where for every i = 0, …, n_indices - 1 indices[i] is interpreted as an index to the array A.

Aarray-like

The array that is indexed.

dimint or tuple of ints

The dimensions of the array that are indexed. If dim equals ‘adaptive’, dim is set to first indices corresponding to the shape of indices. E.g., if indices is of shape (n_indices,), dim is set 0.

unique: bool or `check_unique`

If unique is True unique indices are returned. If unique is ‘check_unique’ an exception is raised if the indices are not unique.

Returns
indices: tuple of np.ndarrays or np.ndarray

The validated indices.