You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
>>> np.random.choice(0, size=0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mtrand.pyx", line 1120, in mtrand.RandomState.choice
ValueError: a must be greater than 0
This is necessary if size > 0, but if size == 0 we could permit this special case. Allowing the valid special case would simplify certain code, and in particular would make np.random.choice(limit, size=min(n, limit) always work. The same goes for np.random.randint:
>>> np.random.randint(0, size=0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "mtrand.pyx", line 993, in mtrand.RandomState.randint
ValueError: low >= high
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
np.random.choice
requires the upper limita > 0
:This is necessary if
size > 0
, but ifsize == 0
we could permit this special case. Allowing the valid special case would simplify certain code, and in particular would makenp.random.choice(limit, size=min(n, limit)
always work. The same goes fornp.random.randint
:The text was updated successfully, but these errors were encountered: