def _parallel_var(avg_a, count_a, var_a, avg_b, count_b, var_b):
    """
    Update var_a with var_b.
    source: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
    """
    idx = count_b > 0
    delta = avg_b - avg_a
    m_a = var_a * count_a
    m_b = var_b * count_b
    var_a[idx] = (
        m_a[idx]
        + m_b[idx]
        + delta[idx] ** 2 * count_a[idx] * count_b[idx] / (count_a[idx] + count_b[idx])
    )
    var_a[idx] = var_a[idx] / (count_a[idx] + count_b[idx])
Update var_a with var_b.
source: https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance
pysteps/verification/detcontscores.py