I want to find mean and standard deviation of 1st, 2nd,... digits of several (Z) lists. For example, I have
A_rank=[0.8,0.4,1.2,3.7,2.6,5.8]
B_rank=[0.1,2.8,
Using python, here are few methods:
import statistics as st
n = int(input())
data = list(map(int, input().split()))
stdev = st.pstdev(data)
variance = st.pvariance(data)
devia = math.sqrt(variance)
mean = sum(data)/n
variance = sum([((x - mean) ** 2) for x in X]) / n
stddev = variance ** 0.5
print("{0:0.1f}".format(stddev))
variance calculates variance of sample population pvariance calculates variance of entire population stdev and pstdev