Re: random.sample with long int items

2006-04-12 Thread jordi
That is just what I need. I did't mind on 'divide and conquer' :( Thanks a lot! -- Jordi -- http://mail.python.org/mailman/listinfo/python-list

Re: random.sample with long int items

2006-04-12 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > e.g. you would do this: random.sample(xrange(10**10), 60) > except it raises an exception. For a population that large and a sample that small (less than sqrt(population size), the chance of collision is fairly small, so you can just discard duplicates

Re: random.sample with long int items

2006-04-12 Thread Steven D'Aprano
On Wed, 12 Apr 2006 06:44:29 -0700, Paul Rubin wrote: > "jordi" <[EMAIL PROTECTED]> writes: >> I need the random.sample functionality where the population grows up to >> long int items. Do you know how could I get this same functionality in >> another way? thanks in advance. > > Nothing stops you

Re: random.sample with long int items

2006-04-12 Thread Steven D'Aprano
On Wed, 12 Apr 2006 06:29:01 -0700, jordi wrote: > I need the random.sample functionality where the population grows up to > long int items. Do you know how could I get this same functionality in > another way? thanks in advance. I'm thinking you might need to find another way to do whatever it i

Re: random.sample with long int items

2006-04-12 Thread Paul Rubin
"jordi" <[EMAIL PROTECTED]> writes: > I need the random.sample functionality where the population grows up to > long int items. Do you know how could I get this same functionality in > another way? thanks in advance. Nothing stops you: >>> from random import sample >>> a = [n**25 for n in

random.sample with long int items

2006-04-12 Thread jordi
I need the random.sample functionality where the population grows up to long int items. Do you know how could I get this same functionality in another way? thanks in advance. Jordi -- http://mail.python.org/mailman/listinfo/python-list