Calculating arithmetic mean one type of average in Python

0 votes
Is there a built-in or standard library method in Python to calculate the arithmetic mean (one type of average) of a list of numbers?
Feb 21, 2022 in Python by Nandini
• 5,480 points
921 views

1 answer to this question.

0 votes

There are ways to calculate mean in Python
For Example:

cal_mean = [2,3,4,5,6,7]
print(sum(cal_mean)/ len(cal_mean))

Output

4.5

Another way to calculate mean in Python is by using Numpy 

import numpy as np
cal_mean = [2,3,4,5,6,7]
np.mean(cal_mean)

Output

4.5
answered Feb 21, 2022 by Dev
• 6,000 points

Related Questions In Python

0 votes
1 answer

How do I convert type of an array in python?

Use the following command to change the ...READ MORE

answered May 24, 2019 in Python by Kishore
838 views
0 votes
1 answer

What are the different types of data types one can use in Python?

Python provides an array of built-in constants, ...READ MORE

answered May 28, 2019 in Python by Harsh
• 260 points
3,046 views
0 votes
1 answer

How to find the type of variable in Python?

i=277 type(i) # int i = 2.56j type(i) # complex i ...READ MORE

answered Jul 16, 2019 in Python by Arvind
• 3,040 points
606 views
0 votes
0 answers
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,072 views
0 votes
1 answer
0 votes
2 answers

What's the difference between %s and %d in Python string formatting?

The reason is that they are using ...READ MORE

answered Feb 8, 2022 in Python by Rahul
• 9,670 points
20,270 views
0 votes
1 answer

Base language of Python

Python is written in C, not completely ...READ MORE

answered Feb 3, 2022 in Python by Dev
• 6,000 points
480 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP