-
Notifications
You must be signed in to change notification settings - Fork 1
Statistics
Jean Dubois edited this page Jun 1, 2023
·
4 revisions
The statistics
module can be imported with the statement import statistics
.
The statistics
module is used to do statistics. To do math, use the math
module.
-
statistics.mean(list)
: calculate the mean of a list of numbers. -
statistics.geometric_mean(list)
: calculate the geometric mean of a list of positive numbers. -
statistics.harmonic_mean(list)
: calculate the harmonic mean of a list of positive numbers. -
statistics.median(list)
: calculate the median of a list of numbers. -
statistics.quantiles(list, n=4, method='exclusive')
: cut a list of numbers inn
parts and returns a list of the values where the list was cut, usingexclusive
orinclusive
method.n
andmethod
are optional. -
statistics.scope(list)
: calculate the scope of a list of numbers:max(list) - min(list)
. -
statistics.mode(list)
: calculate the mode of a list of numbers, i.e. the most common value. -
statistics.multimode(value)
: calculate the modes of a list or a str, i.e. the most common values. It returns a list.