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 »

Fonction get_state - module numpy.random

Signature de la fonction get_state

Description

get_state.__doc__

        get_state()

        Return a tuple representing the internal state of the generator.

        For more details, see `set_state`.

        Parameters
        ----------
        legacy : bool, optional
            Flag indicating to return a legacy tuple state when the BitGenerator
            is MT19937, instead of a dict.

        Returns
        -------
        out : {tuple(str, ndarray of 624 uints, int, int, float), dict}
            The returned tuple has the following items:

            1. the string 'MT19937'.
            2. a 1-D array of 624 unsigned integer keys.
            3. an integer ``pos``.
            4. an integer ``has_gauss``.
            5. a float ``cached_gaussian``.

            If `legacy` is False, or the BitGenerator is not MT19937, then
            state is returned as a dictionary.

        See Also
        --------
        set_state

        Notes
        -----
        `set_state` and `get_state` are not needed to work with any of the
        random distributions in NumPy. If the internal state is manually altered,
        the user should know exactly what he/she is doing.