Let's say I have a NumPy array:
[[7 2]
[7 3]
[2 8]
[4 3]
[5 5]]
Where the 0th index is the x value and the 1st index is the y value. How do I sort these values so that when I put them into the function: (x^2 + y- 11)^2 + (x + y^2 -7)^2, they get sorted in ascending order depending on the results? so the sorted values would look like this:
[[4 3]
[5 5]
[7 2]
[7 3]
[2 8]]
The arrays can have duplicates.
One of my ideas would be to use the .argsort() method, though I don't know how I could implement that.
Thanks!