I have two numpy variables with 32000 entries that are as follows:
>>> files
array(['GAN_0.npy', 'GAN_1.npy', 'GAN_10.npy', ..., 'GAN_822.npy',
'GAN_8220.npy', 'GAN_8221.npy'], dtype='<U13')
>>> files.shape
(32000,)
>>> labels
array([1, 1, 1, ..., 1, 1, 1])
>>> np.unique(labels)
array([0, 1])
>>> labels.shape
(32000,)
In other words, the first variable is a NumPy matrix of strings, while the other is a NumPy matrix of integers. In the first matrix, I have a string list of images names and, in the other matrix, integers as the labels that I am using to identify them (images that start with names GAN_ are 1, whereas images with names RAW_ are 0).
I would like to know if I can split these 32000 entries into 10 subsets of 3200 images each without repetition, being 1600 entries which names start with RAW_ and other 1600 which names start with GAN_. The images' names and labels are shuffled, therefore I cannot simply split the big matrix into 10 submatrices. Therefore, is there any method in Numpy that could create 10 stratified and independent submatrices of samples from 2 classes in Python?
P.s: these two files can be found here