I have two arrays of integers, one very large pool (can have hundreds of thousands of entries) and one samples (can also have many, but only in the order of hundreds/thousands). For each entry in samples, I need to find out if it is in pool. I can do an explicit loop:
import numpy as np
rng = np.random.default_rng(0)
n = 1000
m = 10
pool = rng.integers(0, 100000, n)
samples = rng.integers(0, 100000, m)
is_in_pool = [s in pool for s in samples]
There certainly is a faster variant though.
Any hints?