[issue30880] PCG random number generator

2017-07-08 Thread Tim Peters
Tim Peters added the comment: I agree closing was appropriate at this time. I quite like PCG, but as Raymond said it's more a template for creating PRNGs than a specific generator. So even if a compelling case could be made, there's still a long way to having specific code in mind. In the

[issue30880] PCG random number generator

2017-07-08 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, the previous discussions on the MersenneTwister have all resulted in a decision to stick with it. The PCG family of PRNG is relatively new. IIRC, the paper for it was never accepted for publication and some of its bolder claims haven't been proven.

[issue30880] PCG random number generator

2017-07-08 Thread Evelyn Mitchell
Evelyn Mitchell added the comment: Mark, thanks for the background links. My suggestion is much more constrained than the territory covered by those links. -- ___ Python tracker

[issue30880] PCG random number generator

2017-07-08 Thread Mark Dickinson
Mark Dickinson added the comment: Some previous discussions: "Time for a change of random number generator": https://mail.python.org/pipermail/python-dev/2016-February/143268.html "Should our default random number generator be secure?": (warning: long) https://mail.python.

[issue30880] PCG random number generator

2017-07-08 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- components: +Extension Modules nosy: +mark.dickinson, rhettinger versions: +Python 3.7 ___ Python tracker

[issue30880] PCG random number generator

2017-07-08 Thread Evelyn Mitchell
New submission from Evelyn Mitchell: John Cook tested the quality of the PCG Random Number generator (http://www.pcg-random.org/index.html) and it appears to have good performance. His report is at: https://www.johndcook.com/blog/2017/07/07/testing-the-pcg-random-number-generator

Re: Random number help

2016-11-23 Thread Larry Hudson via Python-list
On 11/23/2016 11:17 AM, Thomas Grops wrote: I need a way of generating a random number but there is a catch: I don't want to include certain numbers, is this possible? random.randint(1,100) works as it will randomly pick numbers between 1 and 100 but say i don't want 48 to come out

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
Thankyou for all your help I have managed to pick a way that works from your suggestions :D -- https://mail.python.org/mailman/listinfo/python-list

Re: Random number help

2016-11-23 Thread MRAB
On 2016-11-23 19:29, Chris Kaynor wrote: On Wed, Nov 23, 2016 at 11:17 AM, Thomas Grops via Python-list <python-list@python.org> wrote: I need a way of generating a random number but there is a catch: I don't want to include certain numbers, is this possible? random.randint(1,100)

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
On Wednesday, 23 November 2016 19:30:21 UTC, Chris Kaynor wrote: > On Wed, Nov 23, 2016 at 11:17 AM, Thomas Grops via Python-list > <python-list@python.org> wrote: > > I need a way of generating a random number but there is a catch: > > > > I don't w

Re: Random number help

2016-11-23 Thread Thomas Grops via Python-list
On Wednesday, 23 November 2016 19:30:04 UTC, Thomas Nyberg wrote: > On 11/23/2016 02:17 PM, Thomas Grops via Python-list wrote: > > I need a way of generating a random number but there is a catch: > > > > I don't want to include certain numbers, is this possible? > &g

Re: Random number help

2016-11-23 Thread Achilleas Michailidis
You can use a while statement until you get a number out of your excluded numbers excludedNumbers = [1,2,3,4] randomNumber = random.randomint(1,100) while randomNumber in excludedNumbers: randomNumber = random.randomint(1,100) After the while you have a number outside the excluded

Re: Random number help

2016-11-23 Thread Chris Kaynor
On Wed, Nov 23, 2016 at 11:17 AM, Thomas Grops via Python-list <python-list@python.org> wrote: > I need a way of generating a random number but there is a catch: > > I don't want to include certain numbers, is this possible? > > random.randint(1,100) works as it will randomly

Re: Random number help

2016-11-23 Thread Thomas Nyberg
On 11/23/2016 02:17 PM, Thomas Grops via Python-list wrote: I need a way of generating a random number but there is a catch: I don't want to include certain numbers, is this possible? random.randint(1,100) works as it will randomly pick numbers between 1 and 100 but say i don't want 48

Re: Random number help

2016-11-23 Thread Marko Rauhamaa
Thomas Grops : > random.randint(1,100) works as it will randomly pick numbers between 1 > and 100 but say i don't want 48 to come out is there a way of doing > this. It needs to be an integer too so not a list unless there is a way > to convert list to int r = 48

Random number help

2016-11-23 Thread Thomas Grops via Python-list
I need a way of generating a random number but there is a catch: I don't want to include certain numbers, is this possible? random.randint(1,100) works as it will randomly pick numbers between 1 and 100 but say i don't want 48 to come out is there a way of doing this. It needs to be an integer

[issue12754] Add alternative random number generators

2016-09-06 Thread STINNER Victor
STINNER Victor added the comment: I agree with what Nick wrote. It became easy to install a third-party module, and we made progress on APIs to get random bytes from the system. I'm not convinced neither that Mersenne Twister limitations are important enough to replace it. If you want to see

[issue12754] Add alternative random number generators

2016-09-06 Thread Nick Coghlan
Nick Coghlan added the comment: Since this issue was opened, a few relevant changes have been made: * firstly the random.SystemRandom API and subsequently the "secrets" module were added to provide ready access to the operating system's cryptographically secure PRNG. This addresses the "At

[issue18386] Better random number generator

2013-07-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- resolution: - rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386 ___

[issue18386] Better random number generator

2013-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: If we were to add another generator, I prefer that we add one with some completely different characteristics (such as being cryptographically strong). I don't want to take the default generator and periodically switch it out with the flavor of the month

[issue18386] Better random number generator

2013-07-06 Thread James Lu
: Better random number generator versions: Python 3.3 Added file: http://bugs.python.org/file30830/dSFMT-src-2.2.1.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386

[issue18386] Better random number generator

2013-07-06 Thread James Lu
Changes by James Lu jam...@gmail.com: -- nosy: -James.Lu type: - enhancement ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386 ___ ___

[issue18386] Better random number generator

2013-07-06 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: Removed file: http://bugs.python.org/file30830/dSFMT-src-2.2.1.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386 ___

[issue18386] Better random number generator

2013-07-06 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386 ___ ___ Python-bugs-list

[issue18386] Better random number generator

2013-07-06 Thread Christian Heimes
Christian Heimes added the comment: Do you want to provide a patch for Python's random module? PS: Please do not upload files that can easily be downloaded from a 3rd party site. It just fills disk space on our server and doesn't provide a benefit for us. -- nosy: +christian.heimes

[issue18386] Better random number generator

2013-07-06 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18386 ___ ___ Python-bugs-list mailing list

[issue18386] Better random number generator

2013-07-06 Thread Raymond Hettinger
Raymond Hettinger added the comment: The bar is rather high for changing the current algorithm which is well studied, has a long period, and is reasonably fast. I do not recommend jumping straight into making a patch before we get agreement that we really want another PRNG when the current

tweaking random number

2012-05-09 Thread Nikhil Verma
Hi All I want to generate a random number of 8 digits which involve 3 number and 5 digits. Like this :- def random_number(): # do something random_number() 123abcde # first 3 numbers and 5 letters after the numbers. I am able to generate the random number 8 digit like this:- def

Re: tweaking random number

2012-05-09 Thread MRAB
On 09/05/2012 08:01, Nikhil Verma wrote: Hi All I want to generate a random number of 8 digits which involve 3 number and 5 digits. Like this :- def random_number(): # do something random_number() 123abcde # first 3 numbers and 5 letters after the numbers. I am able to generate

Re: tweaking random number

2012-05-09 Thread Chris Angelico
On Wed, May 9, 2012 at 5:01 PM, Nikhil Verma varma.nikhi...@gmail.com wrote: Hi All I want to generate a random number of 8 digits which involve 3 number and 5 digits. (That's 3 digits and 5 letters) Pretty easy. Do you want to distinguish between uppercase and lowercase letters? Your

Re: tweaking random number

2012-05-09 Thread Peter Otten
Nikhil Verma wrote: Hi All I want to generate a random number of 8 digits which involve 3 number and 5 digits. Like this :- def random_number(): # do something random_number() 123abcde # first 3 numbers and 5 letters after the numbers. I am able to generate the random number

random number

2012-03-26 Thread Nikhil Verma
Hi All How can we generate a 6 digit random number from a given number ? eg:- def number_generator(id): random.randint(id,99) When i am using this it is sometimes giving me five digit and sometimes 6 . I want to avoid encryption . Can i have alphanumeric 6 digit random number from

Re: random number

2012-03-26 Thread Daniel da Silva
If you want it as an int: random.randint(10, 99) Or as a string: s = '%06d' % random.randint(0, 99) On Mon, Mar 26, 2012 at 2:08 AM, Nikhil Verma varma.nikhi...@gmail.comwrote: Hi All How can we generate a 6 digit random number from a given number ? eg:- def

Re: random number

2012-03-26 Thread Chris Angelico
On Mon, Mar 26, 2012 at 5:08 PM, Nikhil Verma varma.nikhi...@gmail.com wrote: Hi All How can we generate a 6 digit random number from a given number ? eg:- def number_generator(id):     random.randint(id,99) When i am using this it is sometimes giving me five digit and sometimes 6

Re: random number

2012-03-26 Thread Michael Poeltl
* Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]: Hi All How can we generate a 6 digit random number from a given number ? what about this? given_number=123456 def rand_given_number(x): ... s = list(str(x)) ... random.shuffle(s) ... return int(''.join(s)) ... print

Re: random number

2012-03-26 Thread Nikhil Verma
, Nikhil Verma varma.nikhi...@gmail.comwrote: Hi All How can we generate a 6 digit random number from a given number ? eg:- def number_generator(id): random.randint(id,99) When i am using this it is sometimes giving me five digit and sometimes 6 . I want to avoid encryption . Can i

Re: random number

2012-03-26 Thread Grzegorz Staniak
On 26.03.2012, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wroted: How can we generate a 6 digit random number from a given number ? what about this? given_number=123456 def rand_given_number(x): ... s = list(str(x)) ... random.shuffle(s) ... return int(''.join(s

Re: random number

2012-03-26 Thread Peter Otten
that is a number in return you are getting 6 digit alphanumeric string. I tried this s = '%06d' % random.randint(0, 99) it gives : '192862' (a string ) Your question is not very clear. Can you give some more information, what you want to do with your random number, and how the id argument

Re: random number

2012-03-26 Thread Michael Poeltl
...@univie.ac.at wrote: * Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]: Hi All How can we generate a 6 digit random number from a given number ? what about this? given_number=123456 def rand_given_number(x): ... s = list(str(x)) ... random.shuffle(s

Re: random number

2012-03-26 Thread Robert Kern
On 3/26/12 8:50 AM, Grzegorz Staniak wrote: On 26.03.2012, Steven D'Apranosteve+comp.lang.pyt...@pearwood.info wroted: How can we generate a 6 digit random number from a given number ? what about this? given_number=123456 def rand_given_number(x): ... s = list(str(x

Re: random number

2012-03-26 Thread Nikhil Verma
, Mar 26, 2012 at 12:10 PM, Michael Poeltl michael.poe...@univie.ac.at wrote: * Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]: Hi All How can we generate a 6 digit random number from a given number ? what about this? given_number=123456 def rand_given_number

Re: random number

2012-03-26 Thread Robert Kern
On 3/26/12 10:45 AM, Nikhil Verma wrote: Hi Thanks Michael I want exactly wanted this. Great def random_number(id) ...characters = list(string.ascii_lowercase +string.ascii_uppercase +string.digits) I used this this earlier and tried then by using choice . This is great. Note that

Re: random number

2012-03-26 Thread ian douglas
On Mar 26, 2012 12:28 AM, Steven Dapos;Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Mon, 26 Mar 2012 08:40:00 +0200, Michael Poeltl wrote: * Nikhil Verma varma.nikhi...@gmail.com [2012-03-26 08:09]: A truly random six digit number will include any number between 10 through

Re: random number

2012-03-26 Thread Ian Kelly
On Mon, Mar 26, 2012 at 3:24 AM, Michael Poeltl michael.poe...@univie.ac.at wrote: import random, string def random_number(id): ...     characters = list(string.ascii_lowercase + ...                       string.ascii_uppercase + ...                       string.digits) ...     coll_rand =

[issue13704] Random number generator in Python core

2012-03-04 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Demoting from release blocker since the hash collision issue got remedied differently. If this is not needed anymore, please close. -- priority: release blocker - normal ___ Python tracker

[issue13704] Random number generator in Python core

2012-03-04 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: Yes, this ticket can be closed unless there is an interest to include the PRNG in the core. -- resolution: - out of date status: open - pending ___ Python tracker rep...@bugs.python.org

[issue13704] Random number generator in Python core

2012-03-04 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: This is indeed out-of-date. -- status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___

[issue13704] Random number generator in Python core

2012-01-18 Thread Dave Malcolm
Changes by Dave Malcolm dmalc...@redhat.com: -- nosy: +dmalcolm ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___ ___ Python-bugs-list

[issue13704] Random number generator in Python core

2012-01-04 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: Release blocker: I was following the example in #13703. A RNG (PRNG or CSPRNG) is required for randomized hashing function. The patch contains more than just the RNG changes. Only Include/pyrandom.h, Modules/_randommodule.c,

[issue13704] Random number generator in Python core

2012-01-04 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: rhettinger - christian.heimes ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___

[issue13704] Random number generator in Python core

2012-01-04 Thread Barry A. Warsaw
Barry A. Warsaw ba...@python.org added the comment: On Jan 04, 2012, at 07:30 AM, Raymond Hettinger wrote: Why is this listed as a release blocker? It is questionable whether it should be done at all? It is a very aggressive change. It's a release blocker so that the issue won't get ignored

[issue13704] Random number generator in Python core

2012-01-03 Thread Christian Heimes
New submission from Christian Heimes li...@cheimes.de: All proposed fixes for a randomized hashing function raise and fall with a good random number generator to feed the random seed. The seed must be created very early in the startup phase of the interpreter, preferable before the basic types

[issue13704] Random number generator in Python core

2012-01-03 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (for the record, you can use the create patch button which creates a reviewable diff) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704

[issue13704] Random number generator in Python core

2012-01-03 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- keywords: +patch Added file: http://bugs.python.org/file24135/3106cc0a2024.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704

[issue13704] Random number generator in Python core

2012-01-03 Thread Martin v . Löwis
Martin v. Löwis mar...@v.loewis.de added the comment: I disagree with that approach, basically because I disagree that we need a C implementation of MT. Platforms that don't provide /dev/urandom will just have to be less secure. Using the current time (in milliseconds if available) plus the

[issue13704] Random number generator in Python core

2012-01-03 Thread Alex Gaynor
Changes by Alex Gaynor alex.gay...@gmail.com: -- nosy: +alex ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___ ___ Python-bugs-list mailing

[issue13704] Random number generator in Python core

2012-01-03 Thread Christian Heimes
Christian Heimes li...@cheimes.de added the comment: We already have a C implementation of MT in Modules/_randommodule.c. I just suggest that we move the implementation to a place, where we can use it as seed. -- ___ Python tracker

[issue13704] Random number generator in Python core

2012-01-03 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever, ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___

[issue13704] Random number generator in Python core

2012-01-03 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: -ezio.melotti, michael.foord ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___

[issue13704] Random number generator in Python core

2012-01-03 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: christian.heimes - rhettinger nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___

[issue13704] Random number generator in Python core

2012-01-03 Thread Jesús Cea Avión
Changes by Jesús Cea Avión j...@jcea.es: -- nosy: +jcea ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13704 ___ ___ Python-bugs-list mailing list

[issue13704] Random number generator in Python core

2012-01-03 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Why is this listed as a release blocker? It is questionable whether it should be done at all? It is a very aggressive change. -- ___ Python tracker rep...@bugs.python.org

[issue12754] Add alternative random number generators

2011-08-30 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Before trying to find the best (CS)PRNG, can't we start with ssl.RAND_bytes() and ssl.RAND_pseudo_bytes()? I would be nice to use ssl.RAND_pseudo_bytes() to generate crypt.mksalt(): see issue #12858 --

[issue12754] Add alternative random number generators

2011-08-29 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___ ___

[issue12754] Add alternative random number generators

2011-08-29 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: I am no kind of crypto expert, but from what I read, there are no known attacks on chacha8 or salsa20/12 better than brute-forcing the key, and distinguishing the stream from random or deducing state would be considered an attack.

[issue12754] Add alternative random number generators

2011-08-28 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: Earlier this year I wrote Python wrappers for a number of generators: https://github.com/douglasbagnall/riffle They are mostly cryptographic stream ciphers from the ESTREAM[1] project, but I was also interested in dSFMT[2], which is a

[issue12754] Add alternative random number generators

2011-08-28 Thread douglas bagnall
douglas bagnall doug...@paradise.net.nz added the comment: A bit more on the state size and period of the stream ciphers. Chacha and Salsa use 64 bytes (512 bits) of state (vs ~2.5kB for MT19937). Its counter is 64 bits, and its seed can be 320 bits (in cipher-speak, the seed is split between

[issue12754] Add alternative random number generators

2011-08-28 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Thanks Douglas. Can you say what the cryptographic guarantees are for Chacha and Salsa (seeing a stream of randoms doesn't allow you to do deduce internal state, previous randoms, or future randoms)? Is it suitably strong for

[issue12754] Add alternative random number generators

2011-08-17 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: The problem is that the Python API can only produce one number per call and a function call in Python is really slow (it creates a Python frame). If you want to speed it Python, it would be better to add methods to generate arrays to limit the

[issue12754] Add alternative random number generators

2011-08-16 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I don't know if it would help you, but I wrote a C library offering a simple API and supporting various RNG (cryptographic, hardware, pseudo, ...). It reuses existing libraries like GSL, OpenSSL, glib, gcrypt, etc. It supports

[issue12754] Add alternative random number generators

2011-08-16 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: On my laptop, KISS4691 could produce about 110 million random numbers per second (148 millon if inlined), whereas MT19937 produced 118 million random numbers per second. The problem is that the Python API can only produce one

[issue12754] Add alternative random number generators

2011-08-15 Thread Raymond Hettinger
New submission from Raymond Hettinger raymond.hettin...@gmail.com: While keeping the MT generator as the default, add new alternative random number generators as drop-in replacements. Since MT was first introduced, PRNG technology has continued to advance. I'm opening this feature request

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: George Marsaglia's latest random number generator KISS4691 is worth considering, though I am not sure the performance is that different from MT19937. Here is a link to Marsaglia's post on comp.lang.c. Marasglia passed away shortly after (Feb

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: I'm posting the code for comparison of KISS4691 and MT19937. I do realize KISS4691 might not be sufficiently different from MT19937 in characteristics for Raymond Hettinger to consider it. But at least here it is for reference should it be of

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: Another (bug fix) post by Marsaglia on KISS4691: http://www.phwinfo.com/forum/comp-lang-c/460292-ensuring-long-period-kiss4691-rng.html -- ___ Python tracker rep...@bugs.python.org

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Changes by Sturla Molden stu...@molden.no: Removed file: http://bugs.python.org/file22905/prngtest.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Changes by Sturla Molden stu...@molden.no: Added file: http://bugs.python.org/file22906/prngtest.zip ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___

[issue12754] Add alternative random number generators

2011-08-15 Thread Sturla Molden
Sturla Molden stu...@molden.no added the comment: Further suggestions to improve the random module: ** Object-oriented PRNG: Let it be an object which stores the random state internally, so we can create independent PRNG objects. I.e. not just one global generator. ** Generator for

[issue12754] Add alternative random number generators

2011-08-15 Thread Raymond Hettinger
Raymond Hettinger raymond.hettin...@gmail.com added the comment: Please focus your thoughts. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12754 ___

[issue3063] memory leak in random number generation

2010-11-24 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc amaur...@gmail.com added the comment: For the record, this was finally fixed with issue2862: gc.collect() now clears the free-lists during the collection of the highest generation. -- nosy: +amaury.forgeotdarc ___ Python tracker

Re: Weibull distr. random number generation

2010-11-22 Thread Dimos
Hello Mark, Exactly, thanks very much! Dimos --- On Sat, 11/20/10, Mark Dickinson dicki...@gmail.com wrote: From: Mark Dickinson dicki...@gmail.com Subject: Re: Weibull distr. random number generation To: python-list@python.org Date: Saturday, November 20, 2010, 7:09 PM On Nov 19, 3:21 pm

Weibull distr. random number generation

2010-11-20 Thread Dimos
Dear Python list subscribers, Sorry of this has been covered already...This is a newbie question about actual scripting/syntax. I would like to use the random module, and if I understand well the Random class, to create 1300 decimal numbers in python, by providing the 2 Weibull parameters

Re: Weibull distr. random number generation

2010-11-20 Thread Mark Dickinson
On Nov 19, 3:21 pm, Dimos dimos_anastas...@yahoo.com wrote: I would like to use the random module, and if I understand well the Random class, to create  1300 decimal numbers in python, by providing the 2 Weibull parameters (b,c). How this can be done??? import random print random

random number generation

2010-08-16 Thread Jah_Alarm
hi, I need to generate a binary array with a specified average proportion of 1s (e.g. [1 0 0 0 0 1 0 0] has this proportion = 25%). In Matlab I run something like random(m,n)p where p is the value between 0 and 1. I'm trying to use random.randint(0,2,size=[m,n]), but I don't understand how to

Re: random number generation

2010-08-16 Thread Brian Blais
On Aug 16, 2010, at 20:37 , Jah_Alarm wrote: hi, I need to generate a binary array with a specified average proportion of 1s (e.g. [1 0 0 0 0 1 0 0] has this proportion = 25%). In Matlab I run something like random(m,n)p where p is the value between 0 and 1. I'm trying to use

Re: random number generation

2010-08-16 Thread Raymond Hettinger
On Aug 16, 5:37 pm, Jah_Alarm jah.al...@gmail.com wrote: hi, I need to generate a binary array with a specified average proportion of 1s (e.g. [1 0 0 0 0 1 0 0] has this proportion = 25%). In Matlab I run something like random(m,n)p where p is the value between 0 and 1. I'm trying to use

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

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Vlastimil Brom
various GMP random-number operations, depending on value of parameter 'opt' (a string) -- arg is normally an int or mpz (or else gets coerced to mpz), but must be a Python mutable sequence when opt is 'shuf': 'init': initialize random-state to support arg bits of 'good

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread sturlamolden
On 10 Sep, 10:50, Hans Georg Schaathun ge...@ii.uib.no 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. --

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 the

Re: Instatiable Pseudo-Random Number Generator

2009-09-10 Thread Hans Georg Schaathun
On Thu, 10 Sep 2009 02:53:33 -0700 (PDT), sturlamolden sturlamol...@yahoo.no wrote: : On 10 Sep, 10:50, Hans Georg Schaathun ge...@ii.uib.no wrote: : : Can anyone recommend a PRNG which supported multiple instances : with independent states, and that also can return numpy.array (or :

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message qoteitso8ru@ruuvi.it.helsinki.fi, Jussi Piitulainen wrote: Miles Kaufmann writes: I'm curious what algorithm calls for random numbers on a closed interval. The Box-Muller transform, polar form. At least Wikipedia says so. Doesn't seem to be necessary, if I interpret the

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message mailman.1366.1244592006.8015.python-l...@python.org, Esmail wrote: I'm implementing a Particle Swarm Optimizer. Depending on what paper you read you'll see mention of required random values between 0 and 1 which is somewhat ambiguous. I came across one paper that specified the

Re: random number including 1 - i.e. [0,1]

2009-06-14 Thread Lawrence D'Oliveiro
In message mailman.1368.1244607807.8015.python-l...@python.org, Esmail wrote: Here is part of the specification of an algorithm I'm implementing that shows the reason for my original query: vid = w * vid + c1 * rand( ) * ( pid – xid ) + c2 * Rand( ) * (pgd –xid ) (1a) xid = xid + vid (1b)

Re: random number including 1 - i.e. [0,1]

2009-06-11 Thread Esmail
Thanks everyone, I learned more than I expected about floats :-) and got some good explanations and ideas about all of this. Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Dave Angel
Steven D'Aprano wrote: On Tue, 09 Jun 2009 18:28:23 -0700, John Yeung wrote: The docs are now... sort of correct. For some values of a and b, uniform() can never return b. Notably, I believe uniform(0, 1) is equivalent to random(), and will never return 1. However, uniform(1, 2) CAN

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Mensanator
. The Mersenne Twister is one of the most extensively tested random number generators in existence. Is that strictly necessary in the random documentation that defines what the random module does? _I_ appreciate it being there and am glad someone made the effort to put it there. If there is a change from a=Nb

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread John Yeung
On Jun 10, 1:52 am, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Tue, 09 Jun 2009 22:21:26 -0700, John Yeung wrote: Therefore, to me the most up-to-date docs (which say that uniform(a, b) returns a float in the closed interval [a, b]) is closer to correct than before,

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Virgil Stokes
2**19937-1. The underlying implementation in C is both fast and threadsafe. The Mersenne Twister is one of the most extensively tested random number generators in existence. However, being completely deterministic, it is not suitable for all purposes, and is completely unsuitable for cryptographi

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Jussi Piitulainen
Miles Kaufmann writes: [...] I'm curious what algorithm calls for random numbers on a closed interval. The Box-Muller transform, polar form. At least Wikipedia says so. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >