Skip to content

Instantly share code, notes, and snippets.

@juliussin
Created April 25, 2023 01:40
Show Gist options
  • Save juliussin/6589ca8254f6fd9735d74cb713c93541 to your computer and use it in GitHub Desktop.
Save juliussin/6589ca8254f6fd9735d74cb713c93541 to your computer and use it in GitHub Desktop.
Max Min for Multidimensional Array
from operator import itemgetter
x = [[1, 4], [3, 2]]
max(x, key=itemgetter(0))
# >> [3, 2]
max(x, key=itemgetter(1))
# >> [1, 4]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment