-
-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Closed
Description
(This is either a request for an enhancement, or a bug report--take your pick.)
Unlike most of the other distributions implemented in the RandomState class, randint and random_integers do not broadcast their arguments.
For example, hypergeometric broadcasts:
In [87]: rng = np.random.RandomState()
In [88]: rng.hypergeometric(10, [10, 20, 30], 10)
Out[88]: array([6, 2, 1])
But randint only accepts scalar integers:
In [89]: rng.randint(10, [10, 100])
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-89-b14fbd2d38cb> in <module>()
----> 1 rng.randint(10, [10, 100])
mtrand.pyx in mtrand.RandomState.randint (numpy/random/mtrand/mtrand.c:9556)()
TypeError: an integer is required
Reactions are currently unavailable