What is the difference between numpy.random.shuffle(x)
and numpy.random.permutation(x)
?
I have read the doc pages but I could not understand if there was any difference between the two when I just want to randomly shuffle the elements of an array.
To be more precise suppose I have an array x=[1,4,2,8]
.
If I want to generate random permutations of x, then what is the difference between shuffle(x)
and permutation(x)
?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…