• + 0 comments
    # Enter your code here. Read input from STDIN. Print output to STDOUT
    import sys
    import numpy as np
    from scipy import stats
    
    # Read Data
    data = sys.stdin.read().splitlines()
    nums = data[1].split(' ')
    nums = np.array([int(num) for num in nums])
    
    # Calculate Stats
    mean = np.mean(nums)
    median = np.median(nums)
    mode = stats.mode(nums)[0]
    std = np.std(nums)
    z = 1.96
    std_error = (std/(np.sqrt(len(nums))))
    lower = mean - z*std_error
    upper = mean + z*std_error
    
    # Print Output
    print(f"{mean:.1f}")
    print(f"{median:.1f}")
    print(mode)
    print(f"{std:.1f}")
    print(f"{lower:.1f} {upper:.1f}")