Is this a fair test?
I expected shuffle to be much faster
(no array creation).
Alan Isaac

>>> import timeit
>>>
>>> setup = """
... import numpy as np
... prng = np.random.RandomState()
... N = 10**5
... indexes = np.arange(N)
... """
>>>
>>> print timeit.timeit('prng.shuffle(indexes)',setup, number=100)
5.69172311006
>>> print timeit.timeit('indexes = prng.random_sample(N).argsort()',setup, 
>>> number=100)
1.54648202495
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to