Created
April 4, 2021 10:28
-
-
Save CharudattaManwatkar/a4a1783acfe7b6b1bd0bb8c94503cd15 to your computer and use it in GitHub Desktop.
Ellipsis for slicing in Numpy
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 | |
a = np.arange(16).reshape(2,2,2,2) | |
print(a[..., 0].flatten()) | |
print(a[:, :, :, 0].flatten()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment