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 produce a SAMPLESIZE * N > > > matrix, where each row of N values consists of either
> > > 2. A sample of N numbers between 1 and M without repeats (simulating > > > deals of N cards from an M-card deck). Have you considered numpy.random.shuffle ? a = np.arange(1, M+1) result = np.random.shuffle(a)[:N] _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion