Last active
December 30, 2019 05:17
-
-
Save edenau/5f8afbe3a35d65919a9fde6e4dc649c8 to your computer and use it in GitHub Desktop.
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
arr = np.array(range(1000)).reshape(2,5,2,10,-1) | |
print(arr[:,:,:,3,2] == arr[...,3,2]) | |
# [[[ True, True], | |
# [ True, True], | |
# [ True, True], | |
# [ True, True], | |
# [ True, True]], | |
# [[ True, True], | |
# [ True, True], | |
# [ True, True], | |
# [ True, True], | |
# [ True, True]]]) | |
print(arr.shape) # (2, 5, 2, 10, 5) | |
print(arr[...,np.newaxis,:,:,:].shape) # (2, 5, 1, 2, 10, 5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment