Write a NumPy program to shuffle numbers between 0 and 10 (inclusive).
import numpy as np x = np.arange(10) np.random.shuffle(x) print(x) print("Same result using permutation():") print(np.random.permutation(10))
Sample Output:
[2 7 1 5 3 9 0 4 6 8] Same result using permutation(): [8 9 0 4 7 3 1 6 5 2]
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer