unify_locations#

skrough.unify.unify_locations(items: Union[Sequence[int], ndarray[Any, dtype[int64]]]) ndarray[Any, dtype[int64]][source]#

Unify locations-like input.

Unify locations-like input, i.e., numpy.ndarray or a sequence of integer-location based indexing of objects/attributes/elements to a common form of Locations.

Parameters:

items – Locations-like input to be unified into a common form of

:param Locations.:

Returns:

Unified locations.

Examples

>>> unify_locations(np.arange(5))
array([0, 1, 2, 3, 4])
>>> unify_locations([1,2,3])
array([1, 2, 3])
>>> unify_locations([])
array([], dtype=int64)