{ } Raw JSON

bundles / scipy 1.17.1 / scipy / _lib / _util / check_random_state

function

scipy._lib._util:check_random_state

source: /scipy/_lib/_util.py :393

Signature

def   check_random_state ( seed )

Summary

Turn seed into a np.random.RandomState instance.

Parameters

seed : {None, int, `numpy.random.Generator`, `numpy.random.RandomState`}, optional

If seed is None (or np.random), the numpy.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed. If seed is already a Generator or RandomState instance then that instance is used.

Returns

seed : {`numpy.random.Generator`, `numpy.random.RandomState`}

Random number generator.

Aliases

  • scipy.cluster.vq.check_random_state