[Numpy-discussion] Permutations in Simulations`

Mark Janikas mjanikas at esri.com
Tue Feb 10 14:29:07 EST 2009


Hello All,

I want to create an array that contains a column of permutations for each simulation:

import numpy as NUM
import numpy.random as RAND
x = NUM.arange(4.)
res = NUM.zeros((4,100))

for sim in range(100):
res[:,sim] = RAND.permutation(x)


Is there a way to do this without a loop?  Thanks so much ahead of time...

MJ

Mark Janikas
Product Engineer
ESRI, Geoprocessing
380 New York St.
Redlands, CA 92373
909-793-2853 (2563)
mjanikas at esri.com<mailto:mjanikas at esri.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090210/32a155fc/attachment.html>


More information about the NumPy-Discussion mailing list