# 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

import statistics as stat
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)
mean = stat.mean(temps)
med = stat.median(temps)
mode = stat.mode(temps)
vari = stat.variance(temps)
stdev = stat.stdev(temps)
print (f'mean: {mean}, median: {med}, mode: {mode}, variance: {round(vari,3)}, stdev: {round(stdev,3)}')

# Plot the temperatures vs the days as a scatter plot using a red "x"
plt.plot(days, temps, 'rx')
#
# Plot the mean as a horizontal line in green
meanY = np.ones(len(days))*mean
plt.plot(days,meanY, 'g')
#
# Illustrate 1 standard deviation away from the mean by drawing two horizonal lines in
# as dotted blue lines
posSD = meanY + stdev
negSD = meanY - stdev
plt.plot(days, posSD, '--b')
plt.plot(days, negSD, '--b')
plt.show()

import random
ex1 = np.random.randint(100,200,15)
print (ex1)

ex2 = np.random.random(15)
print (ex2)

ex3 = np.random.random(15)
ex3b = 10 + (40-10)*ex3
print (ex3b)

ex4 = np.random.normal(0,1,15)
print (ex4)

ex5 = np.random.normal(20,0.5,15)
print (ex5)