Da die Frage mittlerweile (oder schon immer?) technisch gesehen eine noch bessere Antwort verdient hat, und weil sicher immer mal wieder jemand über Google hier landet, hiermit nun ein weiterer Beitrag:
Bei Standard-Abweichung und Varianz gibt es zwei relevante "Methodiken".
- Die eine nimmt eine Stichprobe it der Anzahl n, wird auch die empirische Methode genannt, und benutzt einen Faktor von 1/(n-1). (Englisch: unbiased sample variance)
- Die andere nimmt die (Grund-)Gesamtheit mit der Anzahl N und benutzt einen Faktor von 1/N. (Englisch: variance, population variance, evtl. auch "basic variance")
Für gängige Formelzeichen, Formeln und weitere Beispiele, siehe auch:
https://www.scribbr.de/statistik/standardabweichung/
Code: Alles auswählen
import numpy as np
a = np.array([[1.5, 3.5, 0.5 ]])
print (np.average(a)) # 1.8333333333333333
# ddof int, optional
# Means Delta Degrees of Freedom.
# The divisor used in calculations is N - ddof,
# where N represents the number of elements.
# By default ddof is zero.
# source for this comment: https://numpy.org/doc/stable/reference/generated/numpy.std.html
print (a.std()) # 1.247219128924647
print (a.std(ddof=0)) # 1.247219128924647
print (a.std(ddof=1)) # 1.5275252316519468
print (a.var()) # 1.5555555555555556
print (a.var(ddof=0)) # 1.5555555555555556
print (a.var(ddof=1)) # 2.3333333333333335
print (a) # [[1.5 3.5 0.5]]