Skip to content

Commit

Permalink
Update randin in base.py
Browse files Browse the repository at this point in the history
Omit the third argument in np.random.random_integers, so the random number is returned directly instead of in an array. In the latter form, numpy throws an error when the length of ind is smaller than 32.
  • Loading branch information
wangjiaji committed Feb 22, 2014
1 parent 021145d commit d4a1dcb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base.py
Expand Up @@ -40,7 +40,7 @@ def randin(grid, pcent):
ind = list()
m = int(n*pcent/100)
while len(ind) != m:
a = np.random.random_integers(0, n, 1)
a = np.random.random_integers(0, n)
if a not in ind:
ind.append(a)
res = grid[ind].ravel()
Expand Down

0 comments on commit d4a1dcb

Please sign in to comment.