Miscellaneous utilities

bytes (length)

Return a string of random bytes of the provided length. get_state ()

Return an object that holds the state of the random number generator (allows you to restart simulations where you left off).

set_state (state)

Set the state of the random number generator. The argument should be the returned object of a previous get_state command.

shuffle (sequence)

Randomly permute the items of any sequence. If sequence is an array, then it must be 1-d.

permutation (n)

Return a permutation of the integers from 0 to n-1.

0 0

Post a comment