Yoann Biliato
1 - Calcul de la moyenne, médiane, variance et écart-type d'un échantillon
import numpy as np
from bokeh.plotting import figure, show, output_file, vplot
from bokeh.charts import Bar
data=np.array([54.8,55.4,57.7,59.6,60.1,61.2,62.0,63.1,63.5,64.2,65.2,65.4,65.9,66.0,67.6,68.1,69.5,70.6,71.5,73.4])
Calcul de la moyenne
xn = 1/n sigma(xi)
somme=np.sum(data)
print(somme)
moyenne=np.mean(data)
print(moyenne)
mediane=np.median(data)
print(mediane)
variance=np.var(data)
print(variance)
ecartType = np.sqrt(variance)
print(ecartType)
from bokeh.charts import Bar, output_file, show
from bokeh.sampledata.autompg import autompg as df
x = np.linspace(-2, 2, 1000)
p = figure(tools="save", background_fill_color="#EFE8E2", title="")
p.segment(data, data, line_width=2, line_color="black")
output_file("bar.html")
show(p)