Harmonic mean with zero value How does harmonic mean handle zero values? what would the harmonic mean of {3, 4, 5, 0} be since $1/0=\infty$?
 A: If you're working in a language that supports Infinity in computations properly, like R, you can define the harmonic mean like so:
harm <- function(x) 1/mean(1/x)

Then it will deal properly with zeroes in a natural way:
> harm(c(6, 2, 9, 4, 3, 1))
[1] 2.541176
> harm(c(6, 2, 9, 4, 0, 3, 1))
[1] 0

A: The algorithm DFLOW by EPA uses the following when there are zero values:
$\mu_H = \left(\frac{\sum^{n_T - n_0}_{i=1} 1/x_i} {n_T - n_0}\right)^{-1} \times \frac{n_T - n_0} {n_T} ,$
where $\mu_H$ is the harmonic mean, $x_i$ is a nonzero value of the data vector, $n_T$ is the (total) sample size, and $n_0$ is the number of zero values. 
A: Just as the geometric mean of anything and $0$ is $0$, it is usually natural to define the harmonic mean of anything and $0$ to be $0$. 
One physical interpretation of the harmonic mean is that if you have resistors in parallel, the total resistance is as though each resistor had the harmonic mean resistance. If one of the resistors has no resistance, there is no resistance over all (a short), and this is the same as if all resistors had no resistance.
If for some reason you are considering the harmonic means of numbers so that some are negative and some are positive, then it might be better to say that a harmonic mean of $0$ with itself is not defined. However, in the applications I know for the harmonic mean, it is used on nonnegative numbers.
