Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Hans Georg Schaathun
On Thu, 10 Sep 2009 02:53:33 -0700 (PDT), sturlamolden wrote: : On 10 Sep, 10:50, Hans Georg Schaathun wrote: : : > Can anyone recommend a PRNG which supported multiple instances : > with independent states, and that also can return numpy.array (or : > something similar) efficiently? : : nu

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Joachim Strömbergson
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Aloha! Hans Georg Schaathun wrote: > Can anyone recommend a PRNG which supported multiple instances > with independent states, and that also can return numpy.array (or > something similar) efficiently? > > The distribution is currently Gaussian. Do

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread sturlamolden
On 10 Sep, 10:50, Hans Georg Schaathun wrote: > Can anyone recommend a PRNG which supported multiple instances > with independent states, and that also can return numpy.array (or > something similar) efficiently? numpy.random.RandomState ;-) S.M. -- http://mail.python.org/mailman/listinfo/pyt

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Vlastimil Brom
2009/9/10 Hans Georg Schaathun : > I wonder if someone knows of an API with the features I need... > random.Random and numpy.random each have only half of it... > > My application includes an object to hold a pseudo-randomly > generated matrix too large to be kept in memory.  Hence I > try to store

Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Hans Georg Schaathun
I wonder if someone knows of an API with the features I need... random.Random and numpy.random each have only half of it... My application includes an object to hold a pseudo-randomly generated matrix too large to be kept in memory. Hence I try to store only the seed, and generate the numbers on

True random number generator

2008-05-24 Thread Zerge
truerandom.py is a Python module that generates true random numbers obtained from www.random.org. Use with the form: mylist=truerandom.getnum(min,max,amount) mylist will be a list containing the true random numbers. If for some reason the numbers cannot be generated, the list will contain -1. Y

Re: Random Number Generator Error

2006-03-18 Thread Fredrik Lundh
"ahmet nurlu" wrote: > It gives error: > Traceback (most recent call last): >File "random.py", line 2, in ? > from pylab import * >File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ? > from matplotlib.pylab import * >File "/usr/lib/python2.4/site-packages/mat

Random Number Generator Error

2006-03-18 Thread ahmet nurlu
Hi, I wrote a random walk program which you will find below.  When I run it from the terminal, it gives error which I am not able to figure out what could be wrong. From the bash shell, I give a command     >python2.4 random.py It gives error: --

Re: What random number generator is used for Numeric and SciPy?

2005-12-18 Thread Robert Kern
The Helmbolds wrote: > > Python bases its random number generators on the Mersenne Twister. > > Do Numeric and SciPy also base their random number generators on the > Mersenne Twister? If not, what do they use? Numeric, numarray and scipy 0.3 use RANLIB. http://www.stat.umn.edu/HELP/ranlib-d

What random number generator is used for Numeric and SciPy?

2005-12-18 Thread The Helmbolds
Python bases its random number generators on the Mersenne Twister.   Do Numeric and SciPy also base their random number generators on the Mersenne Twister? If not, what do they use?-- http://mail.python.org/mailman/listinfo/python-list

Re: random number generator thread safety

2005-11-08 Thread Mike Brown
Raymond Hettinger wrote: > Mike Brown wrote: > > I have questions about thread safety in the 'random' module. > > > > When using the random.Random class (be it Mersenne Twister or Wichmann-Hill > > based), is it sufficiently thread-safe (preserving entropy and guarding > > against attack) to just h

Re: random number generator thread safety

2005-11-08 Thread Raymond Hettinger
> > Thread-safety has nothing to do with preserving entropy or guarding > > against attack. All of the entropy in an MT sequence is contained in > > the seed (upto 624 bytes) and that entropy is preserved through all > > subsequent calls. > > I think the concern is that there can be a thread switc

Re: random number generator thread safety

2005-11-08 Thread Paul Rubin
"Raymond Hettinger" <[EMAIL PROTECTED]> writes: > Thread-safety has nothing to do with preserving entropy or guarding > against attack. All of the entropy in an MT sequence is contained in > the seed (upto 624 bytes) and that entropy is preserved through all > subsequent calls. I think the concer

Re: random number generator thread safety

2005-11-08 Thread Raymond Hettinger
Mike Brown wrote: > I have questions about thread safety in the 'random' module. > > When using the random.Random class (be it Mersenne Twister or Wichmann-Hill > based), is it sufficiently thread-safe (preserving entropy and guarding > against attack) to just have each thread work with its own ran

random number generator thread safety

2005-11-08 Thread Mike Brown
I have questions about thread safety in the 'random' module. When using the random.Random class (be it Mersenne Twister or Wichmann-Hill based), is it sufficiently thread-safe (preserving entropy and guarding against attack) to just have each thread work with its own random.Random instance? Or

Re: random number generator

2005-11-04 Thread Bryan Olson
Fredrik Lundh wrote: >>How to generate a random number in Python. Is there any build in >>function I can call? > > > >>> import random > >>> help(random) If you need crypto-quality randomness: >>> import os >>> help(os.urandom) -- --Bryan -- http://mail.python.org/mailman/listinfo

Re: random number generator

2005-11-03 Thread avnit
import random print random.randint(1,20) #prints random integer from 1 to 20 -- http://mail.python.org/mailman/listinfo/python-list

Re: random number generator

2005-11-03 Thread Fredrik Lundh
> How to generate a random number in Python. Is there any build in > function I can call? >>> import random >>> help(random) also see: http://docs.python.org/lib/module-random.html -- http://mail.python.org/mailman/listinfo/python-list

random number generator

2005-11-03 Thread questions?
How to generate a random number in Python. Is there any build in function I can call? Thanks -- http://mail.python.org/mailman/listinfo/python-list