Mixing arrays like this in numpy are straightforward
Create a large binding index (shuffle np.arange(1000000) ) and index arrays
features = features[I, ...] labels = labels[I] info = info[I, :]
This is not an inplace operation. labels[I] is a copy of labels , not a fragment or representation.
Alternative
features[I,...] = features
looks at the surface as inplace. I doubt that it is, in the C code. It should be buffered because the values ββof I not guaranteed to be unique. Actually there is a special ufunc .at method for unbuffered operations.
But look what h5py says about the same "fancy indexing":
http://docs.h5py.org/en/latest/high/dataset.html#fancy-indexing
labels[I] implemented selection, but with limitations.
List selections may not be empty Selection coordinates must be given in increasing order Duplicate selections are ignored Very long lists (> 1000 elements) may produce poor performance
Your shuffled I by definition, not in ascending order. And he is very big.
Also, I donβt see anything about using this fantastic indexing on my left hand, labels[I] = ...
source share