So I am trying to detect if the values in an array is in a certain range and then return a binary logical array i.e. one for true and zero for false. I have this but iPython keeps complaining
D = ( 1 < X[0,:] + X[1,:]) < 2 ).astype(int)
the interesting thing is that just checking one way works totally ok
D = ( X[0,:] + X[1,:]) < 2 ).astype(int)
which I find a bit perplexing.
1 Answer