Skip to content

Instantly share code, notes, and snippets.

@vaclavcadek
Created September 9, 2017 12:41
Show Gist options
  • Save vaclavcadek/ba3e3563e0fa94e81042c8b739728d2f to your computer and use it in GitHub Desktop.
Save vaclavcadek/ba3e3563e0fa94e81042c8b739728d2f to your computer and use it in GitHub Desktop.
Elegant way to shuffle numpy array - e.g. before training
permutation = list(np.random.permutation(m))
shuffled_X = X[:, permutation]
shuffled_Y = Y[:, permutation].reshape((1,m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment