[Numpy-discussion] random permutation

Keith Goodman kwgoodman at gmail.com
Thu Jan 11 15:36:09 EST 2007


Why is the first element of the permutation always the same? Am I
using random.permutation in the right way?

>> x

matrix([[0],
        [1],
        [2],
        [3]])
>> M.random.permutation(x)

array([[0],
       [1],
       [1],
       [0]])
>> M.random.permutation(x)

array([[0],
       [1],
       [2],
       [2]])
>> M.random.permutation(x)

array([[0],
       [1],
       [0],
       [0]])
>> M.random.permutation(x)

array([[0],
       [0],
       [2],
       [0]])
>> M.random.permutation(x)

array([[0],
       [0],
       [1],
       [0]])

>> M.__version__
'1.0rc1'



More information about the NumPy-Discussion mailing list