Skip to content

Commit 9a71f66

Browse files
Use np.asarray instead of np.array with copy=False
Remove use of np.compat
1 parent a2a1c19 commit 9a71f66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mkl_random/mklrand.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ cdef class RandomState:
16871687
ret = randfunc(low, high - 1, size)
16881688

16891689
if size is None:
1690-
if dtype in (bool, int, np.compat.long):
1690+
if dtype in (bool, int, np.long):
16911691
return dtype(ret)
16921692

16931693
return ret
@@ -1893,7 +1893,7 @@ cdef class RandomState:
18931893
"""
18941894

18951895
# Format and Verify input
1896-
a = np.array(a, copy=False)
1896+
a = np.asarray(a)
18971897
if a.ndim == 0:
18981898
try:
18991899
# __index__ must return an integer by python rules.
@@ -1942,7 +1942,7 @@ cdef class RandomState:
19421942
cdf /= cdf[-1]
19431943
uniform_samples = self.random_sample(shape)
19441944
idx = cdf.searchsorted(uniform_samples, side='right')
1945-
idx = np.array(idx, copy=False) # searchsorted returns a scalar
1945+
idx = np.asarray(idx) # searchsorted returns a scalar
19461946
else:
19471947
idx = self.randint(0, pop_size, size=shape)
19481948
else:

0 commit comments

Comments
 (0)