Created
July 10, 2013 06:02
-
-
Save mmechtley/5963787 to your computer and use it in GitHub Desktop.
Numpy shuffled axis example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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