Return the weighted harmonic mean of x

def hmean(x, weights=None):
    """
    Return the weighted harmonic mean of x
    """
    w_arr, x_arr = _preprocess_inputs(x, weights)
    return w_arr.sum(axis=0) / (w_arr/x_arr).sum(axis=0)