diff options
author | Evan Limanto <evanlimanto@gmail.com> | 2017-02-05 19:08:57 -0800 |
---|---|---|
committer | Evan Limanto <evanlimanto@gmail.com> | 2017-03-10 17:01:55 -0800 |
commit | 7a73bad2d9c04e4f16e87dbed9d7b627327fe814 (patch) | |
tree | 246eb15ba8832cdeffb19d726f64f645b7eb63a6 /numpy/random/mtrand | |
parent | 72839c43f2536c65bc4fbf6db5ae8ebb1c29c674 (diff) | |
download | numpy-7a73bad2d9c04e4f16e87dbed9d7b627327fe814.tar.gz |
BUG: fix issue #8250 where np.random.permutation fails when np.array gets called on an invalid sequence.
Diffstat (limited to 'numpy/random/mtrand')
-rw-r--r-- | numpy/random/mtrand/mtrand.pyx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/numpy/random/mtrand/mtrand.pyx b/numpy/random/mtrand/mtrand.pyx index bf3a385a9..ee0e31172 100644 --- a/numpy/random/mtrand/mtrand.pyx +++ b/numpy/random/mtrand/mtrand.pyx @@ -143,6 +143,7 @@ cdef extern from "initarray.h": import_array() cimport cython +import copy import numpy as np import operator import warnings @@ -4871,7 +4872,7 @@ cdef class RandomState: if isinstance(x, (int, long, np.integer)): arr = np.arange(x) else: - arr = np.array(x) + arr = copy.copy(x) self.shuffle(arr) return arr |