meegsim.location.select_random#

meegsim.location.select_random(src, *, n=1, vertices=None, sort_output=False, random_state=None)[source]#

Randomly selects a specified number of vertices from a given source space.

Parameters:
srcSourceSpaces

An instance of source spaces to select the vertices from.

nint, optional

The number of random vertices to select. By default, one vertex is selected.

verticesNone (default) or list

A subset of vertices to choose from. If None (default), the function uses all vertices from the provided src.

sort_outputbool, optional

Indicates if sorting is needed for the output. By default, the output is not sorted.

random_stateNone (default) or int

Seed for the random number generator. If None (default), results will vary between function calls. Use a fixed value for reproducibility.

Returns:
selectedlist

A list of tuples (index of the source space, vertno of the selected vertex).