def random_partition(n, n_data):
 all_idxs = numpy.arange(n_data)
 numpy.random.shuffle(all_idxs)
 idxs1 = all_idxs[:n]
 idxs2 = all_idxs[n:]
 return (idxs1, idxs2)

def random_partition ( n , n_data ) : all_idxs = numpy . arange ( n_data ) numpy . random . shuffle ( all_idxs ) idxs1 = all_idxs [ : n ] idxs2 = all_idxs [ n : ] return ( idxs1 , idxs2 )
return n random rows of data (and also the other len-n rows) .