Skip to content

Instantly share code, notes, and snippets.

@ij96
Created March 14, 2022 21:28
Show Gist options
  • Save ij96/3d1b2cee7cbdc1aef4873b47a5338bca to your computer and use it in GitHub Desktop.
Save ij96/3d1b2cee7cbdc1aef4873b47a5338bca to your computer and use it in GitHub Desktop.
import numpy as np
def argmax_nd(mat):
return np.unravel_index(mat.argmax(), mat.shape)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment