Skip to content

Commit 49baa06

Browse files
authored
Update operations.rst
np.random.random_integers() is depricated in numpy 1.11, we better use np.random.randint() instead.
1 parent 06483be commit 49baa06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

intro/numpy/operations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ Other reductions
404404
.. sourcecode:: pycon
405405

406406
>>> t = np.arange(t_max)
407-
>>> steps = 2 * np.random.random_integers(0, 1, (n_stories, t_max)) - 1
407+
>>> steps = 2 * np.random.randint(0, 1 + 1, (n_stories, t_max)) - 1 # +1 because the high value is exclusive
408408
>>> np.unique(steps) # Verification: all steps are 1 or -1
409409
array([-1, 1])
410410

0 commit comments

Comments
 (0)