I have the following array of data
In [56]:data
Out[56]:
array([[ 4360., 6178.],
[ 10906., 14956.],
[ 5071., 8963.],
...,
[ 16019., 12300.],
[ 12306., 3327.],
[ 13663., 12641.]])
I want to store in a all the rows whose zeroth element is less than some value value1 and higher than some other value value2.
I have try the following
d[ 9057 > d[0::,0] > 8000, 0::]
and
d[d[0::,0] > 8000 and d[0::,0] < 9057, 0::]
but both are stopped by the following error
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
Is there an efficient way for doing this? Thanks.
The following should do it:
By the way, you can replace all those
0::with::I find this a little easier on the eye.