diff options
author | seberg <sebastian@sipsolutions.net> | 2016-03-05 14:59:41 +0100 |
---|---|---|
committer | seberg <sebastian@sipsolutions.net> | 2016-03-05 14:59:41 +0100 |
commit | a835270d718d299535606d7104fd86d9b2aa68a6 (patch) | |
tree | 1683bf3b005ad2225205bb17d2a47c933df05160 | |
parent | 74487e4a92a7f47fa89cd379b8b49fc7ef22dcde (diff) | |
parent | f6c2e7f714b56e921b8fa8cec48e37da231b66fe (diff) | |
download | numpy-a835270d718d299535606d7104fd86d9b2aa68a6.tar.gz |
Merge pull request #7359 from charris/update-7314
Update 7314, DOC: Clarify valid integer range for random.seed in mtrand.pyx.
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index db4ea13e6..3adeb1990 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -891,10 +891,10 @@ cdef class RandomState: Parameters ---------- seed : {None, int, array_like}, optional - Random seed initializing the pseudo-random number generator. - Can be an integer, an array (or other sequence) of integers of - any length, or ``None`` (the default). - If `seed` is ``None``, then `RandomState` will try to read data from + Random seed used to initialize the pseudo-random number generator. 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 `RandomState` will try to read data from ``/dev/urandom`` (or the Windows analogue) if available or seed from the clock otherwise. @@ -952,13 +952,13 @@ cdef class RandomState: else: idx = operator.index(seed) if idx > int(2**32 - 1) or idx < 0: - raise ValueError("Seed must be between 0 and 4294967295") + raise ValueError("Seed must be between 0 and 2**32 - 1") with self.lock: rk_seed(idx, self.internal_state) except TypeError: obj = np.asarray(seed).astype(np.int64, casting='safe') if ((obj > int(2**32 - 1)) | (obj < 0)).any(): - raise ValueError("Seed must be between 0 and 4294967295") + raise ValueError("Seed must be between 0 and 2**32 - 1") obj = obj.astype('L', casting='unsafe') with self.lock: init_by_array(self.internal_state, <unsigned long *>PyArray_DATA(obj), |