The Harmonic Mean function in Python (scipy.stats.hmean) requires that the input be positive numbers.
scipy.stats.hmean
For example:
from scipy import st
You can just use the Harmonic Mean define equation:
len(a) / np.sum(1.0/a)
But, wikipedia says that harmonic mean is defined for positive real numbers:
http://en.wikipedia.org/wiki/Harmonic_mean