Using np.random.randint to sample from a set of evenly-spaced reals

Question Q6.6.2

In Example E6.18 we used random.random_integers to sample from the uniform distribution on the floating point numbers $[\frac{1}{2}, \frac{3}{2}, \frac{5}{2}, \frac{7}{2}]$. How can you do the same using the np.random.randint instead?


Solution Q6.6.2