Answers for "python mean and standard deviation of list"

0

python mean and standard deviation of list

import numpy as np

# list containing numbers only
l = [1.8, 2, 1.2, 1.5, 1.6, 2.1, 2.8]

# switch to numpy array
v = np.array(l)

mean = v.mean() # average ~ 1.86
std = v.std() # stadrad deviation (square root of variance) ~ 0.48
Posted by: Guest on May-18-2021

Code answers related to "python mean and standard deviation of list"

Python Answers by Framework

Browse Popular Code Answers by Language