# 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
numbers = [ 6, 8, 12, 14 ]
stat.stdev(numbers)
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 (stat.mean (temps))
print (stat.median (temps))
print (stat.mode (temps))
print (stat.variance (temps))
print (stat.pvariance (temps))
print (stat.stdev (temps))
import matplotlib.pyplot as plt
# Plot the temperatures vs the days as a scatter plot using a red "x"
temps = [45, 51, 38, 42, 47, 51, 52, 55, 48, 43]
x = np.array (temps)
y= np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
plt.scatter (x,y)
plt.xlabel('Temperature')
plt.ylabel('Days')
plt.plot (x, y, 'rx')
#
# Plot the mean as a horizontal line in green
plt.axhline(y=47.2, color='g', linestyle='-')
#
# Illustrate 1 standard deviation away from the mean by drawing two horizonal lines in
# as dotted blue lines
plt.axhline(y=52.445, color='b', linestyle=':')
plt.axhline(y=41.755, color='b', linestyle=':')
plt.show()
import numpy as np
np.random.seed(12345)
x = np.random.randint (low = 100, high = 200, size = 15)
print (x)
x = np.random.uniform (size = 15)
print (x)
xp = np.random.uniform (size = 15)
x = 15 + (40-10)*x
print (x)
x = np.random.normal (size = 15)
print (x)
x = np.random.normal (size = 15)
x = 20 + (.5)*x
print (x)