'How to separate coordinates in a numpy array belonging to different quadrant?
I have a NumPy array containing small arrays of [x,y] coordinate. I want to separate the coordinates belonging to different quadrants.I have tried to use NumPy.where like this:
row,col=np.where(sort_list[0]>0 and sort_list[1]>0)
postive_values=sort_list[row,col]
row,col=np.where(sort_list[0]<0 and sort_list[1]<0)
negetive_values=sort_list[row,col]
However, I get an error as follows:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
How do I do this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
