# Start writing code here...
# pip install numpy
import numpy as np

# Estimate the mean tail score for this population, using a 99 percent confidence interval.
scores=np.array([114, 100, 104, 89, 102, 91, 114, 114, 103, 105, 108, 130, 120, 132, 111, 128, 118, 119, 86, 72, 111, 103, 74, 112, 107, 103, 98, 96, 112, 112, 93])

# we could compute at this point the required mean, xmean, and corresponding confidence interval according to the formula,
# xmean ± zcrit * sigma / sqrt(n), where sigma and n are respectively
# the standard deviation and size of the data, and zcrit is the critical value corresponding to the confidence.
# In this case, we could look up a table on any statistics book to obtain a crude approximation to its value, zcrit = 2.576.
xmean = np.mean(scores)
sigma = np.std(scores)
n = np.size(scores)
xmean, xmean - 2.576 * sigma / np.sqrt(n), xmean +2.576 * sigma / np.sqrt(n)
# We have thus computed the estimated mean tail score (with value 105.83870967741936) and the interval of confidence (from about 99.34 to approximately 112.79).
# We have done so using purely NumPy-based operations, while following a known formula.

#directly ask SciPy for assistance instead of above formula
import scipy as scp
result = scp.stats.bayes_mvs(scores,alpha=0.99)
print(result)

help(scp.stats.bayes_mvs)

np.info('random')

dir()

import numpy as np
import matplotlib.pyplot as plt
x=np.linspace(0,np.pi,32)
fig=plt.figure()
#fig.pyplot(x,np.sin(x))
#fig.savefig('sine.png')
plt.show()

import skimage
from skimage import data # most functions are in subpackage
s

!pip install scikit-image

import skimage
from skimage import data # most functions are in subpackage
camera = data.camera()
print (camera.dtype,camera.shape,camera.size)
#if we want all entries of an already-created array to be 32-bit floating point values, we may cast it as follows
img=camera.astype('float32')
scores =np.array([101,103,84],dtype='float32')
scores=np.float32([101,103,84])
from skimage import filters
filtered_camera = filters.gaussian(camera, 1)
type(filtered_camera)

a=np.array(['Cleese', 'Idle', 'Gilliam'], dtype='str_')
a.dtype

dt=np.dtype([ ('name', np.str_, 16), ('grades', np.float64, (2,)) ])

MA141 = np.array([ ('Cleese', (7.0,8.0)), ('Gilliam', (9.0,10.0)) ], dtype=dt)