pythonbook icon indicating copy to clipboard operation
pythonbook copied to clipboard

https://ethanweed.github.io/pythonbook/03.01-descriptives.html#mean-absolute-deviation

Open bbishop423 opened this issue 1 year ago • 0 comments

Correcting variable naming in python code:

from statistics import mean

X = [56, 31, 56, 8, 32] # 1. enter the data X_bar = mean(X) # 2. find the mean of the data AD = [] # 3. find the absolute value of the difference between for i in X: # each value and the mean and add it to the list AD
AD.append(abs((i-X_bar)))
AAD = mean(AD) # 4. find the mean of the absolute values print(AAD)

bbishop423 avatar Feb 19 '24 21:02 bbishop423