I have an array called points
that has the shape (408046, 2) (408046 pairs of x,y) and an array called pointsValue
that has the shape (408046,) (the values at the 408046 pairs of x,y). I am trying to sort points
based on its value from pointsValue
. I have tried using the method explained another StackOverflow question (Sorting list based on values from another list?) using the below syntax
pointSorted = [x for _,x in sorted(zip(points,pointsValue),reverse=True)]
However, the above gives me an error saying "ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()"
Thanks.