Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Comment

PREVIOUS NEXT
Code Example
Python :: discord.py ban 
Python :: how to open any application using python 
Python :: pipenv freeze requirements.txt 
Python :: how to time a python script 
Python :: python - convert index to a column 
Python :: discord py bot status 
Python :: count unique values numpy 
Python :: django model plural 
Python :: print json python 
Python :: get current file name python 
Python :: count number of matrix islands python 
Python :: python filter array 
Python :: django versatileimagefield 
Python :: keyerror dislike_count pafy 
Python :: How to fix snap "pycharm-community" has "install-snap" change in progress 
Python :: python - give a name to index column 
Python :: flask run app reset on change 
Python :: user agents list 
Python :: python duplicate file 
Python :: Convert the sklearn.dataset cancer to a DataFrame. 
Python :: python system year 
Python :: how to permanently store data in python 
Python :: sklearn rmsle 
Python :: how to save a dictionary to excel in python 
Python :: visualize correlation matrix python 
Python :: how to create a random number between 1 and 10 in python 
Python :: scroll to element python selenium 
Python :: generate random string python 
Python :: set index to column pandas 
Python :: how to find runner up score in python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =