Is there a pythonic way to carry around metadata that describes the training examples, such that it preserves (i.e., order) after shuffling and splitting (train/test)?

X = np.array([[1,2,3],[4,5,6]]) # examples
y = [0,1] # labels
meta = ["Hot day", "Cold day"] # metadata

1 Answer 1


The shuffle function in sklearn.utils shuffles arrays or sparse matrices in a consistent way.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.