for i in range(0, np.size(tx)):
    index = (ox - oe < tx[i]) & (ox + oe > tx[i]) & (oy - oe < ty[i]) & (oy +
        oe > ty[i]) & (oz - oe < tz[i]) & (oz + oe > tz[i])
result[index] += 1
Speeding up a numpy loop in python?