Skip to content

Commit 0114776

Browse files
committed
BUG fixed sampling from Categorical
1 parent 7ba3ea3 commit 0114776

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pymc3/distributions/discrete.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def __init__(self, p, *args, **kwargs):
345345

346346
def random(self, point=None, size=None, repeat=None):
347347
p, k = draw_values([self.p, self.k], point=point)
348-
return generate_samples(partial(np.random.choice, k),
348+
return generate_samples(partial(np.random.choice, np.arange(k)),
349349
p=p,
350350
broadcast_shape=p.shape[:-1] or (1,),
351351
dist_shape=self.shape,

0 commit comments

Comments
 (0)