[Numpy-discussion] Reminder: code freeze for bet at the end of the WE

Charles R Harris charlesr.harris@gmail....
Sat Mar 14 14:11:27 CDT 2009


Hi Josef,

On Sat, Mar 14, 2009 at 12:14 PM, <josef.pktd@gmail.com> wrote:
<snip>


> {{{
> import numpy as np
>
> assert np.all(np.random.hypergeometric(3,18,11,size=10) < 4)
> assert np.all(np.random.hypergeometric(18,3,11,size=10) > 0)
>
> pr = 0.8
> N = 100000
> rvsn = np.random.logseries(pr,size=N)
> # these two frequency counts should be close to theoretical numbers
> with this large sample
> assert np.sum(rvsn==1) / float(N) > 0.45   # theoretical:  0.49706795
> assert np.sum(rvsn==1) / float(N) < 0.23   # theoretical:  0.19882718
> }}}
>

I just see one frequency count here. Do you mean that the frequency count
should fall in that range with some probability?

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090314/5e494f37/attachment.html 


More information about the Numpy-discussion mailing list