numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersBackRef
Generator(bit_generator)

Generator exposes a number of methods for generating random numbers drawn from a variety of probability distributions. In addition to the distribution-specific arguments, each method takes a keyword argument size that defaults to None . If size is None , then a single value is generated and returned. If size is an integer, then a 1-D array filled with generated values is returned. If size is a tuple, then an array with that shape is filled and returned.

The function numpy.random.default_rng will instantiate a Generator with numpy's default BitGenerator .

No Compatibility Guarantee

Generator does not provide a version compatibility guarantee. In particular, as better algorithms evolve the bit stream may change.

Notes

The Python stdlib module random contains pseudo-random number generator with a number of methods that are similar to the ones available in Generator . It uses Mersenne Twister, and this bit generator can be accessed using MT19937 . Generator , besides being NumPy-aware, has the advantage that it provides a much larger number of probability distributions to choose from.

Parameters

bit_generator : BitGenerator

BitGenerator to use as the core generator.

Container for the BitGenerators.

See Also

default_rng

Recommended constructor for :None:None:`Generator`.

Examples

>>> from numpy.random import Generator, PCG64
... rng = Generator(PCG64())
... rng.standard_normal() -0.203 # random
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy

72 Elements
scipy.spatial._kdtree.KDTree.count_neighbors
scipy.spatial._qhull.ConvexHull
scipy.fft._realtransforms.idctn
scipy.signal._bsplines.cspline1d_eval
scipy.optimize._basinhopping.basinhopping
scipy.interpolate._bsplines.make_lsq_spline
scipy.fft._helper.next_fast_len
scipy.linalg._expm_frechet.expm_frechet
scipy.signal._signaltools.choose_conv_method
scipy.signal._signaltools.lfilter
scipy.linalg.blas.get_blas_funcs
scipy.interpolate._ndgriddata.griddata
scipy.signal._signaltools.detrend
scipy.signal._bsplines.cspline1d
scipy.signal._signaltools.oaconvolve
scipy.linalg.blas.find_best_blas_type
scipy.linalg._decomp_svd.subspace_angles
scipy.sparse.linalg._eigen.lobpcg.lobpcg.lobpcg
scipy.optimize._optimize.check_grad
scipy.signal._signaltools.filtfilt
scipy.fft._basic.ifft
scipy.interpolate._fitpack2.UnivariateSpline
scipy.linalg._decomp_svd.null_space
scipy.sparse._construct.random
scipy.signal._spectral_py.csd
scipy.spatial._plotutils.voronoi_plot_2d
scipy.fft._realtransforms.idstn
scipy.spatial._kdtree.KDTree.query_pairs
scipy.optimize._dual_annealing.VisitingDistribution
scipy.signal._signaltools.correlate
scipy.spatial._plotutils.convex_hull_plot_2d
scipy.spatial._kdtree.KDTree.sparse_distance_matrix
scipy.linalg._decomp_qz.qz
scipy.signal._spectral_py.istft
scipy.interpolate._ndgriddata.NearestNDInterpolator
scipy.linalg._decomp_qr.qr
scipy.linalg._basic.pinv
scipy.signal._signaltools.correlate2d
scipy.signal._signaltools.wiener
scipy.signal._bsplines.qspline1d
scipy.fft._realtransforms.dctn
scipy.interpolate._polyint.KroghInterpolator
scipy.spatial._qhull.tsearch
scipy.signal._spectral_py.lombscargle
scipy.interpolate._fitpack2.LSQUnivariateSpline
scipy.signal._filter_design.freqz
scipy.sparse.linalg._eigen._svds.svds
scipy.signal._signaltools.sosfiltfilt
scipy.signal._signaltools.correlation_lags
scipy.signal._bsplines.qspline1d_eval
scipy.fft._basic.ifftn
scipy.signal._spectral_py.welch
scipy.spatial._plotutils.delaunay_plot_2d
scipy.interpolate._fitpack2.InterpolatedUnivariateSpline
scipy.signal._spectral_py.spectrogram
scipy.interpolate._rbfinterp.RBFInterpolator
scipy.optimize._minpack_py.curve_fit
scipy.fft._pocketfft.helper.set_workers
scipy.signal._spectral_py.periodogram
scipy.linalg._decomp_svd.svd
scipy.optimize._zeros_py.newton
scipy.spatial._kdtree.KDTree.query_ball_tree
scipy.interpolate._rbf.Rbf
scipy.linalg.lapack.get_lapack_funcs
scipy.signal._signaltools.fftconvolve
scipy.signal._spectral_py.coherence
scipy.signal._spectral_py.stft
scipy.linalg._basic.pinvh
scipy.fft._basic.fftn
scipy.fft._realtransforms.dstn
scipy.linalg._decomp_qr.rq
scipy.interpolate.interpnd.LinearNDInterpolator

numpy

numpy.random.mtrand.RandomState
numpy.random
numpy.random._generator.Generator
numpy.random._generator.default_rng

networkx

networkx.utils.misc.create_random_state

dask

dask.array.routines.corrcoef

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/random/_generator.cpython-39-darwin.so#None
type: <class 'type'>
Commit: