Skip to content

Instantly share code, notes, and snippets.

@CharudattaManwatkar
Created April 4, 2021 10:28
Show Gist options
  • Save CharudattaManwatkar/a4a1783acfe7b6b1bd0bb8c94503cd15 to your computer and use it in GitHub Desktop.
Save CharudattaManwatkar/a4a1783acfe7b6b1bd0bb8c94503cd15 to your computer and use it in GitHub Desktop.
Ellipsis for slicing in Numpy
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