HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Statistic Methods : Calculate the harmonic mean of the given data
The statistics.harmonic_mean()
method calculates
the harmonic mean (central location) of the given data set.
Harmonic mean = The reciprocal of the arithmetic mean() of the reciprocals of the data.
The harmonic mean is calculated as follows:
If you have four values (a, b, c and d) - it will be equivalent to 4 / (1/a + 1/b + 1/c + 1/d).
Parameter | Description |
---|---|
data | Required. The data values to be used (can be any sequence, list or iterator). Note: Cannot contain negative values! |
Return Value: | A float value, representing the harmonic
mean
of the given data |
---|---|
Python Version: | 3.6 |