def random_uniform_range(shape=[1,],low=0,high=1):
"""
Random uniform range
Produces a random uniform distribution of specified shape, with arbitrary max and
min values. Default shape is [1], and default range is [0,1].
"""
return numpy.random.rand(shape) * (high - min) + min
import numpy as np
import time
rang = 10000
tic = time.time()
for i in range(rang):
sampl = np.random.uniform(low=0, high=2, size=(182))
print("it took: ", time.time() - tic)
tic = time.time()
for i in range(rang):
ran_floats = [np.random.uniform(0,2) for _ in range(182)]
print("it took: ", time.time() - tic)