choice

sherpa.utils.random.choice(rng: Generator | RandomState | None, xs: Sequence, n) ndarray[source] [edit on github]

Create a subset of elements from xs with no duplication.

Parameters:
rngnumpy.random.Generator, numpy.random.RandomState, or None

Determines how the random numbers are created. If set to None then the numpy.random.choice routine is used.

xs

Sequence of values.

n

The number of values to select from xs.

Returns:
valuesndarray