Answers for "shuffle data in a numpy ndarray"

1

shuffle array python

import random
random.shuffle(array)
Posted by: Guest on August-30-2021
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

Python Answers by Framework

Browse Popular Code Answers by Language