samedi 15 avril 2017

Random sequence and random position? [duplicate]

This question already has an answer here:

I know how to generate random sequence of list of numbers. Here is an example :

lst = np.arange(10) #lst always 0 .. n
np.shuffle(lst)

the question is how to shuffle the numbers so that the number ONE is NOT at position ONE, 2 is not at pos 2, and in general x is not at position x. For all 0 .. n




Aucun commentaire:

Enregistrer un commentaire