0% found this document useful (0 votes)
9 views2 pages

Statistics Module

The document provides an overview of the statistics module in Python, which includes functions for calculating mean, median, and mode of numeric data. Examples are given for each function to demonstrate their usage. Key takeaways highlight the definitions of mean, median, and mode.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Statistics Module

The document provides an overview of the statistics module in Python, which includes functions for calculating mean, median, and mode of numeric data. Examples are given for each function to demonstrate their usage. Key takeaways highlight the definitions of mean, median, and mode.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

2/10/26, 5:06 PM Chapter Wise

Statistics module
Statistics Module in Python

The statistics module provides functions for calculating mathematical statistics of numeric
data. It is useful for analyzing datasets in education, research, and data science.

To use it, first import:

import statistics

Mean (Average)

Returns the average of the data.

data = [10, 20, 30, 40, 50]


print([Link](data)) # 30

data2 = [5, 15, 25]


print([Link](data2)) # 15

Median

Returns the middle value when the data is sorted.

data = [10, 20, 30, 40, 50]


print([Link](data)) # 30

data2 = [10, 20, 30, 40]


print([Link](data2)) # 25.0 (average of 20 and 30)

Mode

Returns the most frequently occurring value.

data = [10, 20, 30, 40, 40, 50]


print([Link](data)) # 40

data2 = [1, 2, 2, 3, 3, 3, 4]
print([Link](data2)) # 3

[Link]:8000/articles/?grade=9&subject=21 1/2
2/10/26, 5:06 PM Chapter Wise

Key Takeaways

mean() → Average value


median() → Middle value
mode() → Most frequent value

[Link]:8000/articles/?grade=9&subject=21 2/2

You might also like