Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

networkx.utils.misc.create_random_state

create_random_state(random_state=None)[source]

Returns a numpy.random.RandomState instance depending on input.

Parameters

random_state (int or RandomState instance or None optional (default=None)) – If int, return a numpy.random.RandomState instance set with seed=int. if numpy.random.RandomState instance, return it. if None or numpy.random, return the global random number generator used by numpy.random.