Answers for "np shuffle array"

0

np shuffle

arr = np.arange(10)
>>> np.random.shuffle(arr)
>>> arr
[1 7 5 2 9 4 3 6 0 8] # random
Posted by: Guest on November-18-2021
0

Python shuffle array

import random
new_array = random.sample( array, len(array) )
Posted by: Guest on July-21-2021

Python Answers by Framework

Browse Popular Code Answers by Language