In these cases it is easier and faster to use numpy.random.rand. Maybe set np.random.seed in some cases.