Python Statistics Module



The Python Statistics module provides functions for calculating mathematically real data. Python has a built-in module; this function supports int, float, decimal and fractional.

If your input data consists of mixed data types, then we are able to use a map (float, input_data) to ensure a consistent result.

Some datasets use NaN (not a number) to represent missing data. NaN has unusual comparison semantics; they cause surprising or undefined behaviors in the statistics function that sort data to that count occurrence.

Averages and measures of central location

These functions calculate an average or typical value from a population or sample.

S.No Function & Description
1

mean()

Arithmetic mean("average") of data.

2

fmean()

Floating point arithmetic mean, with optional weighting.

3

geometric_mean()

Geometric mean of data.

4

harmonic_mean()

Harmonic mean of data.

5

median()

Median (middle value) of data.

6

median_low()

Low median of data.

7

median_high()

High median of data.

8

median_grouped()

Median (50th percentile) of grouped data.

9

mode()

Single mode (most common value) of discrete or nominal data.

10

multimode()

List of modes(most common values) of discrete or nominal data.

11

quantiles()

Divide the data into intervals with equal probability.

Measures of spread

These functions calculate a measure of how much the population or sample tends to deviate from the typical or average values.

S.No Module & Description
1

pstdev()

Population standard deviation of data.

2

pvariance()

Population variance of data.

3

stdev()

Sample standard deviation of data.

4

variance()

Sample variance of data.

Statistics for relations between two inputs

These functions calculate statistics regarding relations between two inputs.

S.No Module & Description
1

covariance()

Sample covariance for two variables.

2

correlation()

Pearson's correlation coefficient r takes values between -1 and +1.

3

linear_regression()

Slope and intercept for simple linear regression.

Note:

These functions do not require the data given to be sorted.

python_modules.htm
Advertisements