So I'm trying to sort an array like this by the third item in the array:
[[591 756 3]
[296 669 7]
[752 560 2]
[476 474 0]
[214 459 1]
[845 349 6]
[122 145 4]
[476 125 5]
[766 110 8]]
so it would look like
[[476 474 0]
[214 459 1]
[752 560 2]
[591 756 3]
....and so on]
This is the code I'm currently using:
sortedanswers = sorted(answithcpoints,key=lambda x:x[2])
but printing sortedanswers would output something like
[array([476, 474, 0]), array([214, 459, 1]), array([752, 560, 2]), array([591, 756, 3]), array([122, 145, 4]), array([476, 125, 5]), array([845, 349, 6]), array([296, 669, 7]), array([766, 110, 8])]
seems to be some sort of array inside the array?
Does anyone know why it's doing this?