python - numpy multinomial function returns value error -


i using numpy.random.multinomial(1,val) numpymultinomial, val 1-d numpy array. function gives following error:

valueerror('sum(pvals[:-1]) > 1.0',)

however, checked sum of input array val using val.sum() , sums 1. don't know if multinomial function has bug. can 1 me out this. alternatively, there other python module can use sampling using multinomial distribution?

i found strange behaviour due negative values in array val. had case val summed 0.9999996, contained negative element , due multinomial function throws valueerror, misleading of course because sum never exceeded 1.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -