summaryrefslogtreecommitdiff
path: root/numpy/random/mtrand
diff options
context:
space:
mode:
authorEvan Limanto <evanlimanto@gmail.com>2017-02-05 19:08:57 -0800
committerEvan Limanto <evanlimanto@gmail.com>2017-03-10 17:01:55 -0800
commit7a73bad2d9c04e4f16e87dbed9d7b627327fe814 (patch)
tree246eb15ba8832cdeffb19d726f64f645b7eb63a6 /numpy/random/mtrand
parent72839c43f2536c65bc4fbf6db5ae8ebb1c29c674 (diff)
downloadnumpy-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.pyx3
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