# 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 ('%.3f'%stat.mean (temps))
print ('%.3f'%stat.median (temps))
print (stat.mode (temps))
print ('%.3f'%stat.variance (temps))
print ('%.3f'%stat.stdev (temps))
# Plot the temperatures vs the days as a scatter plot using a red "x"
plt.plot (temps, 'rx')
plt.plot (days, 'rx')
#
# Plot the mean as a horizontal line in green
mean = stat.mean (temps)
x = np.linspace(1, n, n)
y = np.ones( len(x) ) * mean
plt.plot (y, 'g')
#
# Illustrate 1 standard deviation away from the mean by drawing two horizonal lines in
# as dotted blue lines
std = stat.stdev (temps)
plt.plot (std, '--b')
plt.show()
import random
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
print (random.randint(100, 200))
x = np.random.uniform(size = 15)
print (x)
x= np.random.randint ( low = 10, high = 40, size = 15)
print (x)
x = np.random.normal(size = 15)
print (x)
x = np.random.normal(size = 15)
x = 20 + (0.5) * x
print (x)