Random sampling (numpy.random) — NumPy v1.22 Manual
numpy.org › doc › stableJun 22, 2021 · Here PCG64 is used and is wrapped with a Generator. from numpy.random import Generator, PCG64 rng = Generator(PCG64(12345)) rng.standard_normal() Here we use default_rng to create an instance of Generator to generate a random float: >>> import numpy as np >>> rng = np.random.default_rng(12345) >>> print(rng) Generator (PCG64) >>> rfloat = rng.random() >>> rfloat 0.22733602246716966 >>> type(rfloat) <class 'float'>.