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 :

Module « numpy.random »

Classe « RandomState »

Informations générales

Héritage

builtins.object
    RandomState

Définition

class RandomState(builtins.object):

Description [extrait de RandomState.__doc__]

    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 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__
__reduce__
__repr__(self) Return repr(self). [extrait de __repr__.__doc__]
__setstate__
__str__(self) Return str(self). [extrait de __str__.__doc__]
beta
binomial
bytes
chisquare
choice
dirichlet
exponential
f
gamma
geometric
get_state
gumbel
hypergeometric
laplace
logistic
lognormal
logseries
multinomial
multivariate_normal
negative_binomial
noncentral_chisquare
noncentral_f
normal
pareto
permutation
poisson
power
rand
randint
randn
random
random_integers
random_sample
rayleigh
seed
set_state
shuffle
standard_cauchy
standard_exponential
standard_gamma
standard_normal
standard_t
tomaxint
triangular
uniform
vonmises
wald
weibull
zipf

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

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