Skip to content

Instantly share code, notes, and snippets.

@mmechtley
Created July 10, 2013 06:02
Show Gist options
  • Save mmechtley/5963787 to your computer and use it in GitHub Desktop.
Save mmechtley/5963787 to your computer and use it in GitHub Desktop.
Numpy shuffled axis example
import numpy as np
arr = np.arange(100).reshape(4,5,5)
indexes = np.arange(5)
np.random.shuffle(indexes)
dim2shuff = arr[:,indexes,:]
dim3shuff = arr[:,:,indexes]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment