Vous avez des améliorations (ou des corrections) à proposer pour ce document :
je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
spawn(n_children)
Create new independent child generators.
See :ref:`seedsequence-spawn` for additional notes on spawning
children.
.. versionadded:: 1.25.0
Parameters
----------
n_children : int
Returns
-------
child_generators : list of Generators
Raises
------
TypeError
When the underlying SeedSequence does not implement spawning.
See Also
--------
random.BitGenerator.spawn, random.SeedSequence.spawn :
Equivalent method on the bit generator and seed sequence.
bit_generator :
The bit generator instance used by the generator.
Examples
--------
Starting from a seeded default generator:
>>> # High quality entropy created with: f"0x{secrets.randbits(128):x}"
>>> entropy = 0x3034c61a9ae04ff8cb62ab8ec2c4b501
>>> rng = np.random.default_rng(entropy)
Create two new generators for example for parallel execution:
>>> child_rng1, child_rng2 = rng.spawn(2)
Drawn numbers from each are independent but derived from the initial
seeding entropy:
>>> rng.uniform(), child_rng1.uniform(), child_rng2.uniform()
(0.19029263503854454, 0.9475673279178444, 0.4702687338396767)
It is safe to spawn additional children from the original ``rng`` or
the children:
>>> more_child_rngs = rng.spawn(20)
>>> nested_spawn = child_rng1.spawn(20)
Améliorations / Corrections
Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.
Emplacement :
Description des améliorations :