Created
January 5, 2019 20:34
-
-
Save eloidrai/2edaff0370d8dcc35657962367fe7342 to your computer and use it in GitHub Desktop.
Fonctions de statistique
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def effectif(serie): | |
return len(serie) | |
def mediane(serie): | |
serie.sort() | |
return (serie[math.floor((len(serie)-1)/2)]+serie[math.ceil((len(serie)-1)/2)])/2 | |
def etendue(serie): | |
return max(serie)-min(serie) | |
def moyenne(serie): | |
return sum(serie)/len(serie) | |
def pond(serie): | |
v=[] | |
for i in serie: | |
v=v+i | |
return v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment