Skip to content

Commit

Permalink
Merge pull request #503 from QuantEcon/fix-random-draw
Browse files Browse the repository at this point in the history
FIX: random.draw: Replace `random_sample` with `random`
  • Loading branch information
mmcky authored Sep 3, 2019
2 parents 7d1b305 + aae9c79 commit 35215de
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions quantecon/random/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,13 @@ def draw(cdf, size=None):
"""
if isinstance(size, types.Integer):
def draw_impl(cdf, size):
rs = np.random.random_sample(size)
rs = np.random.random(size)
out = np.empty(size, dtype=np.int_)
for i in range(size):
out[i] = searchsorted(cdf, rs[i])
return out
else:
def draw_impl(cdf, size):
r = np.random.random_sample()
r = np.random.random()
return searchsorted(cdf, r)
return draw_impl

0 comments on commit 35215de

Please sign in to comment.