[Numpy-discussion] How do I seed the radom number generator? (original) (raw)
Keith Goodman kwgoodman at gmail.com
Thu Jun 22 15:45:15 EDT 2006
- Previous message (by thread): [Numpy-discussion] How do I seed the radom number generator?
- Next message (by thread): [Numpy-discussion] How do I seed the radom number generator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 6/22/06, Robert Kern <robert.kern at gmail.com> wrote:
Keith Goodman wrote: > How do I seed rand and randn?
If you can, please use the .rand() and .randn() methods on a RandomState object which you can initialize with whatever seed you like. In [1]: import numpy as np rs In [2]: rs = np.random.RandomState([12345678, 90123456, 78901234]) In [3]: rs.rand(5) Out[3]: array([ 0.40355172, 0.27449337, 0.56989746, 0.34767024, 0.47185004])
Perfect! Thank you.
- Previous message (by thread): [Numpy-discussion] How do I seed the radom number generator?
- Next message (by thread): [Numpy-discussion] How do I seed the radom number generator?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]