Re: [Numpy-discussion] Generating random samples without repeats

2008-09-19 Thread Paul Moore
Robert Kern robert.kern at gmail.com writes: On Thu, Sep 18, 2008 at 16:55, Paul Moore pf_moore at yahoo.co.uk wrote: I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE * N matrix, where each row of N values

Re: [Numpy-discussion] Generating random samples without repeats

2008-09-19 Thread Pierre GM
On Friday 19 September 2008 05:08:20 Paul Moore wrote: Robert Kern robert.kern at gmail.com writes: On Thu, Sep 18, 2008 at 16:55, Paul Moore pf_moore at yahoo.co.uk wrote: I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to

Re: [Numpy-discussion] Generating random samples without repeats

2008-09-19 Thread Anne Archibald
2008/9/19 Paul Moore [EMAIL PROTECTED]: Robert Kern robert.kern at gmail.com writes: On Thu, Sep 18, 2008 at 16:55, Paul Moore pf_moore at yahoo.co.uk wrote: I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE

Re: [Numpy-discussion] Generating random samples without repeats

2008-09-19 Thread Paul Moore
Rick White rlw at stsci.edu writes: It seems like numpy.random.permutation is pretty suboptimal in its speed. Here's a Python 1-liner that does the same thing (I think) but is a lot faster: a = 1+numpy.random.rand(M).argsort()[0:N-1] This still has the the problem that it generates

[Numpy-discussion] Generating random samples without repeats

2008-09-18 Thread Paul Moore
I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE * N matrix, where each row of N values consists of either 1. Integers between 1 and M (simulating M rolls of an N-sided die), or 2. A sample of N numbers

Re: [Numpy-discussion] Generating random samples without repeats

2008-09-18 Thread Robert Kern
On Thu, Sep 18, 2008 at 16:55, Paul Moore [EMAIL PROTECTED] wrote: I want to generate a series of random samples, to do simulations based on them. Essentially, I want to be able to produce a SAMPLESIZE * N matrix, where each row of N values consists of either 1. Integers between 1 and M