From: Serge R. <se...@ro...> - 2001-08-08 04:39:43
|
i'm trying to use the results of permutation (from RandomArray.py) to reorder the rows of an array: >>> r=arange(20) >>> id=permutation(20) >>> y=r[id] Traceback (most recent call last): File "<stdin>", line 1, in ? IndexError: invalid index >>> i can use a for loop to permutate the ordering of r, but that has a speed hit associated with it. can anyone offer a suggestion for a way to do this more efficiently? thanks, serge -- Sergio J. Rey http://typhoon.sdsu.edu/rey.html |