I want my array to pass two conditions. If I try to do this with just one I don't have any problems but if I'll give code two conditions python crashes. Here is my code:
import numpy as np
from collections import deque
queue = deque([], maxlen=10)
queue.appendleft(31)
queue.appendleft(32)
queue.appendleft(33)
cond1 = 35
cond2 = 30
A_1 = np.array(queue)
print(cond2 > A_1 < cond1)
# print(A_1 > 30) # works
# array([ True, True, True], dtype=bool)
print(((cond2 > A_1 < cond1).sum() == A_1.size).astype(np.int))
# print(((A_1 > 30).sum() == A_1.size).astype(np.int)) # works
# 1
(cond2 > A_1) & (A_1 < cond1)((cond2 > A_1 < cond1).sum() == A_1.size).astype(np.int)is trying to do.(cond1 > A_1) & (A_1 < cond2)... does that make more sense now?