Skip to content

Instantly share code, notes, and snippets.

@gdshen
Created September 4, 2017 07:28
Show Gist options
  • Save gdshen/42e55b0184a2785506c4e242c0d09aa8 to your computer and use it in GitHub Desktop.
Save gdshen/42e55b0184a2785506c4e242c0d09aa8 to your computer and use it in GitHub Desktop.
numpy mgrid
# generate (0,0), (0,1), ... , (0,4), (1,0), (1,1), ... (1, 4), ..., (4,4) pair
np.mgrid[0:5, 0:5].T.reshape(-1, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment