Plot incompatible with the code above it

In https://lectures.quantecon.org/py/python_by_example.html I think there is an error because realisations of uniform(0,1) random variables cannot be smaller than 0 or larger that 1.

def generate_data(n, generator_type):
ϵ_values = []
for i in range(n):
if generator_type == ‘U’:
e = np.random.uniform(0, 1)
else:
e = np.random.randn()
ϵ_values.append(e)
return ϵ_values
data = generate_data(100, ‘U’)
plt.plot(data)
plt.show()

Not very important. Cheers.

Thanks! I must have used the wrong figure. @natashawatkins Would you mind to put together a PR?

Now that you are revising this page, the figure below the code chunk immediately following the above and also the figure below the code chunk in the solution to Exercise 5 are also incorrect. Sorry, being a teacher for 30 years, my eyes are trained to see the errors first. You have created an extremely valuable learning resource, thank you!

Thanks :-)

Your teacher trained eyes are valuable to us!

@natashawatkins Would you mind to handle this too?

Thanks @farshid-vahid for noticing this! I’ve edited the lecture so the site should be updated soon.