Skip to content

Instantly share code, notes, and snippets.

@dcortesnet
Last active February 11, 2024 02:57
Show Gist options
  • Save dcortesnet/8a411962ddfcd840e74663546a4d768f to your computer and use it in GitHub Desktop.
Save dcortesnet/8a411962ddfcd840e74663546a4d768f to your computer and use it in GitHub Desktop.
Python ordenar un array 2d por un dato
students = [['Harry', 37.21], ['Berry', 37.21], ['Tina', 37.2], ['Akriti', 41], ['Harsh', 39]]
data_sorted = sorted(students, key=lambda x: x[1])
print(data_sorted)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment