Participer au site avec un Tip
Rechercher
 

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 :

Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé
Module « numpy.random »

Classe « RandomState »

Informations générales

Héritage

builtins.object
    RandomState

Définition

class RandomState(builtins.object):

help(RandomState)

    RandomState(seed=None)

    Container for the slow Mersenne Twister pseudo-random number generator.
    Consider using a different BitGenerator with the Generator container
    instead.

    `RandomState` and `Generator` expose 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.

    **Compatibility Guarantee**

    A fixed bit generator using a fixed seed and a fixed series of calls to
    'RandomState' methods using the same parameters will always produce the
    same results up to roundoff error except when the values were incorrect.
    `RandomState` is effectively frozen and will only receive updates that
    are required by changes in the internals of Numpy. More substantial
    changes, including algorithmic improvements, are reserved for
    `Generator`.

    Parameters
    ----------
    seed : {None, int, array_like, BitGenerator}, optional
        Random seed used to initialize the pseudo-random number generator or
        an instantized BitGenerator.  If an integer or array, used as a seed for
        the MT19937 BitGenerator. Values can be any integer between 0 and
        2**32 - 1 inclusive, an array (or other sequence) of such integers,
        or ``None`` (the default).  If `seed` is ``None``, then the `MT19937`
        BitGenerator is initialized by reading data from ``/dev/urandom``
        (or the Windows analogue) if available or seed from the clock
        otherwise.

    Notes
    -----
    The Python stdlib module "random" also contains a Mersenne Twister
    pseudo-random number generator with a number of methods that are similar
    to the ones available in `RandomState`. `RandomState`, besides being
    NumPy-aware, has the advantage that it provides a much larger number
    of probability distributions to choose from.

    See Also
    --------
    Generator
    MT19937
    numpy.random.BitGenerator

    

Constructeur(s)

Signature du constructeur Description
__new__(*args, **kwargs) Create and return a new object. See help(type) for accurate signature. [extrait de __new__.__doc__]
__init__(self, /, *args, **kwargs) Initialize self. See help(type(self)) for accurate signature. [extrait de __init__.__doc__]

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__getstate__(self)
__reduce__(self)
__repr__(self)
__setstate__(self, state)
__str__(self) Return str(self). [extrait de __str__.__doc__]
beta(self, a, b, size=None)
binomial(self, n, p, size=None)
bytes(self, length)
chisquare(self, df, size=None)
choice(self, a, size=None, replace=True, p=None)
dirichlet(self, alpha, size=None)
exponential(self, scale=1.0, size=None)
f(self, dfnum, dfden, size=None)
gamma(self, shape, scale=1.0, size=None)
geometric(self, p, size=None)
get_state(self, legacy=True)
gumbel(self, loc=0.0, scale=1.0, size=None)
hypergeometric(self, ngood, nbad, nsample, size=None)
laplace(self, loc=0.0, scale=1.0, size=None)
logistic(self, loc=0.0, scale=1.0, size=None)
lognormal(self, mean=0.0, sigma=1.0, size=None)
logseries(self, p, size=None)
multinomial(self, n, pvals, size=None)
multivariate_normal(self, mean, cov, size=None, check_valid='warn', tol=1e-08)
negative_binomial(self, n, p, size=None)
noncentral_chisquare(self, df, nonc, size=None)
noncentral_f(self, dfnum, dfden, nonc, size=None)
normal(self, loc=0.0, scale=1.0, size=None)
pareto(self, a, size=None)
permutation(self, x)
poisson(self, lam=1.0, size=None)
power(self, a, size=None)
rand(self, *args)
randint(self, low, high=None, size=None, dtype=<class 'int'>)
randn(self, *args)
random(self, size=None)
random_integers(self, low, high=None, size=None)
random_sample(self, size=None)
rayleigh(self, scale=1.0, size=None)
seed(self, seed=None)
set_state(self, state)
shuffle(self, x)
standard_cauchy(self, size=None)
standard_exponential(self, size=None)
standard_gamma(self, shape, size=None)
standard_normal(self, size=None)
standard_t(self, df, size=None)
tomaxint(self, size=None)
triangular(self, left, mode, right, size=None)
uniform(self, low=0.0, high=1.0, size=None)
vonmises(self, mu, kappa, size=None)
wald(self, mean, scale, size=None)
weibull(self, a, size=None)
zipf(self, a, size=None)

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce_ex__, __setattr__, __sizeof__, __subclasshook__

Vous êtes un professionnel et vous avez besoin d'une formation ? Sensibilisation à
l'Intelligence Artificielle
Voir le programme détaillé