This code should probably be re factored to reduce complexity since a lot of appending could slow things down a lot.

random_dict = lambda: {str(var): random.uniform(*ranges[var]) for var in ranges}
out = [random_dict() for i in range(numsamples)]