[SciPy-user] multinomial-like randint

Ed Schofield schofield at ftw.at
Tue Jan 24 09:10:34 CST 2006

daishi at egcrc.net wrote:

>i'm wondering if i'm missing a function
>which does something along the lines of
>the following:

>i've found scipy.random.randint which is uniform,
>and scipy.random.multinomial, which returns
>multi-sample counts which i don't need.
>i realize the above is pretty simple, but i
>imagine that this must be a relatively common
>need, and i'd rather not loop in python, so
>i feel like i must not be looking in the right
Yes, this is exactly what the 'intsampler' class in the new Monte Carlo
package does.  I described it in the thread [New maximum entropy and
Monte Carlo packages] a few days ago.  The code is still in the sandbox
of the SVN tree.  I had to make some changes to get it to build with
MinGW.  I haven't yet had access to a Windows machine to test it, but
once I've tested it I'll move it into the main tree, hopefully in a few

If you'd like to use it now, you can check out the latest SciPy from SVN
and uncomment the line


in scipy/Lib/sandbox/setup.py before building SciPy.

-- Ed

More information about the SciPy-user mailing list