How to create a set of random numbers with numpy

You could use np.random.choice without replacement as follows:

import numpy as np
gen = np.random.Generator(np.random.PCG64())
def with_numpy_gen(lo, hi, ss):
  return gen.choice(np.arange(lo, hi + 1), ss, replace=False)