Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to find avrage python

# Example to find avearge of list
from numpy import mean
number_list = [45, 34, 10, 36, 12, 6, 80]
avg = mean(number_list)
print("The average is ", round(avg,2))
Comment

how to find avrage python

# Example to find average of list
number_list = [45, 34, 10, 36, 12, 6, 80]
avg = sum(number_list)/len(number_list)
print("The average is ", round(avg,2))
Comment

how to find avrage python

Input : [4, 5, 1, 2, 9, 7, 10, 8]
Output : Average of the list = 5.75
Explanation:
Sum of the elements is 4+5+1+2+9+7+10+8 = 46
and total number of elements is 8.
So average is 46 / 8 = 5.75

Input : [15, 9, 55, 41, 35, 20, 62, 49]
Output : Average of the list = 35.75
Explanation:
Sum of the elements is 15+9+55+41+35+20+62+49 = 286
and total number of elements is 8.
So average is 46 / 8 = 35.75
Comment

PREVIOUS NEXT
Code Example
Python :: pandas dataframe for loop begin end index 
Python :: discord.py setup_hook 
Python :: root value of a column pandas 
Python :: how to get mac address in python 
Python :: flask api 
Python :: write image out opencv 
Python :: check if variable is empty python 
Python :: append multiple values to 2d list python 
Python :: python sklearn knn regression example 
Python :: python assert is datetime 
Python :: raw input py 
Python :: confusion matrix with labels sklearn 
Python :: how to center a string python 
Python :: pyqt5 plain text edit get text 
Python :: device gpu pytorch 
Python :: empty list in python 
Python :: format in python 
Python :: extract outliers from boxplot 
Python :: python set timezone of datetime 
Python :: character to ascii python 
Python :: scikit tsne 
Python :: one line if statement python without else 
Python :: how to find unique values in numpy array 
Python :: draw bounding box matplotlib 
Python :: python merge list of dict into single dict 
Python :: nested for loop table python 
Python :: how to make a button open a new window in python 
Python :: python built in functions 
Python :: array sort python 
Python :: pandas.get_dummies 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =