I am having troubles working with NumPy arrays as I am new to NumPy. I have a big input which I read with sys.stdin, which is consisted of lines with 2 values and a space between them, representing a point or two coordinates. I then save it in a list which looks something like this:
np.array([[1, 3], [5, 6], [7, 2], [9, 9]]) I want to sort the list by their sums and then by their x-coordinate, but I am not sure how to do this.
I am also not sure how would I add that sum as the third element of each sublist, in case I wanted to add it.