[Numpy-discussion] [Q] RandomArray has a problem ??

주기형 newton at admin.kias.re.kr
Tue Mar 5 16:52:19 CST 2002


Hi,

RandomArray has a problem?

I use python2.0, Numpy 20.3.

simple source code is ...
--------------------------------
#!/usr/bin/env python
import math
import Numeric
import RandomArray
import sys

RandomArray.seed(1234,5678)
i=0L
while 1:
    i = i+1
    a = RandomArray.randint(0,100)
    if a==100:
        print 'i=',i, 'a=',a

---------------------------------

and result is
---------------------------------
i= 70164640 a= 100
i= 152242967 a= 100
i= 159619195 a= 100
i= 173219763 a= 100
i= 200933959 a= 100
i= 233219191 a= 100
i= 276114822 a= 100
i= 313589319 a= 100
i= 340689813 a= 100
i= 402397265 a= 100
i= 456099215 a= 100
i= 506078935 a= 100
i= 547758957 a= 100
i= 559163554 a= 100
i= 570211180 a= 100
..........
---------------------------------
RandomArray.randint(0,100) has range 
0<= RandomArray.randint(0,100) <100.
But, result is not...somtime, a==100 arise.

So, I upgrade to python 2.2 and Numpy 21b3.
But, I met same problem.
And, so, I change the os Mandrake 8.0 to Redhat 7.2.
But, same problem...

I don't know what is my mistake...

Please help me ...

                    Kee-Hyoung Joo

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20020305/61baec19/attachment-0001.html 


More information about the Numpy-discussion mailing list