This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / random / bit_generator / ISeedSequence / generate_state

cython_function_or_method

numpy.random.bit_generator:ISeedSequence.generate_state

Summary

Return the requested number of words for PRNG seeding.

Extended Summary

A BitGenerator should call this method in its constructor with an appropriate n_words parameter to properly seed itself.

Parameters

n_words : int
dtype : np.uint32 or np.uint64, optional

The size of each word. This should only be either uint32 or uint64. Strings ('uint32', 'uint64') are fine. Note that requesting uint64 will draw twice as many bits as uint32 for the same n_words. This is a convenience for BitGenerators that express their states as uint64 arrays.

Returns

state : uint32 or uint64 array, shape=(n_words,)

Aliases

  • numpy.random.bit_generator.ISeedSequence.generate_state