# 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]
meantemps = stat.mean(temps)
mediantemps = stat.median(temps)
modetemps = stat.mode(temps)
vartemps = stat.variance(temps)
vartemps = round(vartemps, 3)
sdtemps = stat.stdev(temps)
sdtemps = round(sdtemps, 3)
print(f"The mean is {meantemps}, the median is {mediantemps}, the mode is {modetemps}, the variance is {vartemps} & the standard deviation is {sdtemps}" )
# for plotting purposes I have added an array of days from 1 to 10
days = []
days = np.linspace(1,10,10)
print(days)
# 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
meanarr = np.ones(len(days))
meanarr = meanarr*meantemps
plt.plot(days,meanarr,'g')
#
# Illustrate 1 standard deviation away from the mean by drawing two horizonal lines in
# as dotted blue lines
sdarrup = meanarr + sdtemps
sdarrdown = meanarr - sdtemps
plt.plot(days,sdarrup,'--b')
plt.plot(days,sdarrdown,'--b')
plt.show()
import numpy as np
np.random.seed(12345)
x = np.random.randint ( low = 100, high = 200, size = 15)
print(x)
y = np.random.uniform(size = 15)
print (y)
z = np.random.uniform(size = 15)
z2 = 10 + (40-10)*z
print(z2)
norm = np.random.normal(size = 15)
print(norm)
norm2 = np.random.normal(size = 15)
norm2 = 20 + (0.5)*norm2
print(norm2)