I would like to use numpy to draw a random value from a continuous uniform distribution from the open range (0,5). My eyes have fallen on numpy.random.uniform(0,5). However, according to the documentation and some posts, this includes the closed interval [0,5] or a semi-open interval [0,5).
I have looked at many posts and so far not found good answers. Answers so far include: you don't need to use a fully open range because drawing the start and end values is nearly impossible (only in theory) or there are debates about whether it is actually semi-open or fully closed. The best solution I thought about so far is:
import numpy as np
rn = np.random.uniform(sys.float_info.epsilon, 5-sys.float_info.epsilon)
print(rn)
or using numpy's next_after:
import numpy as np
rn = np.random.uniform(np.nextafter(0,1), np.nextafter(5,0))
print(rn)
Obviously, I would not bother everyone if I did not have a very good reason for drawing (in theory) from a completely open range. I would really appreciate thoughts about how I could plausibly argue that I am drawing a random value from a continuous uniform distribution on the completely open interval (0,5).
Thanks in advance!