this question might be phrased way more convoluted than it is, since I am rather sure the solution is rather generic.
The Situation is as follows. We are given a numpy array of (n, 3), where n is the number of points specified in 3D coordinates (x,y,z). I now want to produce a slice of this array, that contains all the points the fall in a certain area. For example whose x-value is between -50 and 50 and the z-value below 10.
I could certainly iterate over the whole array and check the conditions for every point, however, I do suspect some numpy magic to exist that makes this operation a whole lot faster. Maybe you can help me to come up with an idea.
Thank you! :)
for x,y,z in points:
if x >= x_lower and x <= x_upper and y >= y_lower and y <= y_upper and z.... and so on:
#keep this point