Python statistics module

Python statistics module

Python statistics module provides the functions to mathematical statistics of numeric data. There are some popular statistical functions defined in this module.

mean() function

The mean() function is used to calculate the arithmetic mean of the numbers in the list.

Example

Output:

Mean is : 4.857142857142857

median() function

The median() function is used to return the middle value of the numeric data in the list.

Example

Output:

Median of data-set is : 4.5

mode() function

The mode() function returns the most common data that occurs in the list.

Example

Output:

Calculated Mode 2

stdev() function

The stdev() function is used to calculate the standard deviation on a given sample which is available in the form of the list.

Example

Output:

Standard Deviation of sample is 1.5811388300841898

median_low()

The median_low function is used to return the low median of numeric data in the list.

Example

Output:

Low median of the data-set is 5

median_high()

The median_high function is used to return the high median of numeric data in the list.

Example

Output:

High median of the data-set is 6

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/263670.html

(0)
上一篇 2022年5月30日
下一篇 2022年5月30日

相关推荐

发表回复

登录后才能评论