# import statistics library as stat
#
import statistics as stat
#
# import matplotlib.pyplot as plt and NumPy as np
import matplotlib.pyplot as plt
import numpy as np
temps = [45, 51, 38, 42, 47, 51, 52, 55, 48, 43]
n = len(temps)
# for plotting purposes I have added an array of days from 1 to 10
days = np.linspace(1,n,n)
print (f' the average temperature is {stat.mean(temps)} degrees ')
print ( f' the median temperature is {stat.median(temps)} degrees ')
print (f' the mode is {stat.mode(temps)}')
print (f' the variance is {stat.variance(temps)} ')
print (f' the standard deviation is {stat.stdev(temps)} ')
# Plot the temperatures vs the days as a scatter plot using a red "x"
#
# Plot the mean as a horizontal line in green
#
# Illustrate 1 standard deviation away from the mean by drawing two horizonal lines in
# as dotted blue lines
plt.show()
x= np.array([days])
yt= np.array([temps])
plt.plot (x, yt, 'rx')
plt.axhline(y=47.2, color = 'g')
# i know this isnt how we were taught to do that but i couldnt figure it out
plt.axhline(y=(47.2 +5.245),color='blue',linestyle='--')
plt.axhline(y=(47.2 - 5.245), color = 'blue', linestyle = '--')
plt.title ('temperature over time')
plt.xlabel ('days')
plt.ylabel ('temperatures')
#this is my attempt with stuff that we have learned
x= np.array([days])
yt= np.array([temps])
y= 0
xa = np.linspace(0, 10, 50)
plt.plot (x, yt, 'rx')
plt.plot (xa, y +47.2, 'g')
import numpy as np
np.random.seed (123456)
print (np.random.randint (low= 100, high = 200, size = 15))
print (np.random.uniform (size= 15))
print (np.random.normal (size= 15))
x = (np.random.uniform (size= 10))
y = 10. + x* (40-10) / (1-0)
print (y)
x = np.random.normal (size = 15)
x
x = np.random.normal (size = 15)
y = 20 + x * (0.5)
y