def harmonic_mean(frequencies1, frequencies2):
    """Finds the harmonic mean of the absolute differences between two frequency profiles, 
    expressed as dictionaries.
    Assumes every key in frequencies1 is also in frequencies2

    >>> harmonic_mean({'a':2, 'b':2, 'c':2}, {'a':1, 'b':1, 'c':1})
    1.0
    >>> harmonic_mean({'a':2, 'b':2, 'c':2}, {'a':1, 'b':1, 'c':1})
    1.0
    >>> harmonic_mean({'a':2, 'b':2, 'c':2}, {'a':1, 'b':5, 'c':1}) # doctest: +ELLIPSIS
    1.285714285...
    >>> harmonic_mean(normalise({'a':2, 'b':2, 'c':2}), \
                      normalise({'a':1, 'b':5, 'c':1})) # doctest: +ELLIPSIS
    0.228571428571...
    >>> harmonic_mean(normalise({'a':2, 'b':2, 'c':2}), \
                      normalise({'a':1, 'b':1, 'c':1})) # doctest: +ELLIPSIS
    0.0
    >>> harmonic_mean(normalise({'a':2, 'b':2, 'c':2}), \
                      normalise({'a':1, 'b':1, 'c':0})) # doctest: +ELLIPSIS
    0.2
    """
    total = 0.0
    for k in frequencies1:
        if abs(frequencies1[k] - frequencies2[k]) == 0:
            return 0.0
        total += 1.0 / abs(frequencies1[k] - frequencies2[k])
    return len(frequencies1) / total