• + 0 comments
    S = sorted([v for v,f in zip(values,freqs) for _ in range(f)])
    L = len(S)
    Q1 = (S[(L//4)-1] + S[(L//4)]) /2 if L%4 == 0 else S[L//4]
    Q3 = (S[3*(L//4)-1] + S[3*(L//4)]) /2 if 3*L%4 == 0 else S[3*L//4]
    print( f"{Q3 - Q1:.1f}")