Výběr generátoru náhodných čísel
In [35]:
import numpy as np
In [36]:
#Permuted congruential generator (PCG64) - default in numpy
rng=np.random.Generator(np.random.PCG64())
print(rng.random(10))
print(rng)
[0.04382256 0.28282651 0.3828239 0.41447534 0.99663007 0.84289737 0.38199588 0.59488145 0.63904885 0.78557834] Generator(PCG64)
In [37]:
#Merenne twister psedourandom generator (MT19937)
rng=np.random.Generator(np.random.MT19937())
print(rng.random(10))
print(rng)
[0.48856657 0.34610656 0.24271399 0.93542626 0.70193571 0.62585589 0.08424134 0.10386876 0.89815821 0.54008713] Generator(MT19937)