for i in range(2, 6):
    t = time.time()
n = 10 ** i + 1
m = int(ratio * n)
print(i, n, m)
ip = np.random.random_integers(10, size=(n, 3))
jp = np.random.random_integers(10, size=(m, 3))
chunksize = 10000
if chunksize > ip.shape[0]:
    chunksize = ip.shape[0]
span = ip.shape[0] / chunksize
remainder = ip.shape[0] - span * chunksize
out = []
start = 0
for n in range(span):
    end = start + chunksize
a = np.expand_dims(ip[start:end], -1) == jp.T
b = np.where(a.all(axis=1).any(axis=1))[0]
out.append(b + start)
start += chunksize
if remainder != 0:
    a = np.expand_dims(ip[-remainder:], -1) == jp.T
b = np.where(a.all(axis=1).any(axis=1))[0]
out.append(b + end)
end = np.sort(np.concatenate(out))
print(time.time() - t, end.shape)
numpy missing attributes depending on array size