Machine Learning – Mean

Mean is used to get the mean i.e. the average values. It is a statistical measure that is calculated by adding the values. The result is then divided by the number of observations.

Example

Let’s say you have marks of 10 students in Mathematics subject and the average marks are to be calculated. For that, add the marks of all the students and divide by 10. This will be the mean.

Coding Example – Calculate Mean with Python

Let us see an example. To calculate the mean in Python, we will use the mean() method of the NumPy package.

The NumPy package is used for scientific computing with Python. We will also use the Pandas library to create a Pandas Dataframe. The Pandas DataFrame is a Two-dimensional tabular data structure i.e. table with rows and columns.

Read: Free NumPy Tutorial

Read: Free Pandas Tutorial

The following is the Python code to get the mean marks of 10 students:

The following is the output;

Let us now see what is a median with an example.


If you liked the tutorial, spread the word and share the link and our website Studyopedia with others.


For Videos, Join Our YouTube Channel: Join Now


Read More:

Descriptive vs Inferential Statistics
Machine Learning – Median
Studyopedia Editorial Staff
contact@studyopedia.com

We work to create programming tutorials for all.

No Comments

Post A Comment

Discover more from Studyopedia

Subscribe now to keep reading and get access to the full archive.

Continue reading