import numpy as np
zeros = np.zeros(5956-700, dtype=bool)
ones=np.ones(700, dtype=bool)
arr=np.concatenate((ones,zeros), axis=0, out=None)
np.random.shuffle(arr)#Now, this array 'arr' is shuffled, with 700 Trues and rest False
Example - there should be 5 elements in an array with 3 True and rest False.
ones= np.ones(3, dtype=bool) #array([True, True, True])
zeros= np.zeros(5-3, dtype=bool) #array([False, False])
arr=np.concatenate((ones,zeros), axis=0, out=None) #arr - array([ True, True, True, False, False])
np.random.shuffle(arr) # now arr - array([False, True, True, True, False])
ato 1.