I have a numpy array of size (24, 131000). The first of these 24 columns contains an index corresponding to a number in the range [0, 25], for each of the 131000 rows. I want to slice this array to generate 26 separate arrays, each containing the data corresponding to a single index.
I've tried this as follows:
for index in huge_array[0]:
new_array = huge_array[:, huge_array[0] == index]
np.save(...) # saves each of the 26 new arrays separately
Problem is this takes literal hours to be done. Does anyone know of better and more efficient ways to slice this array?