The standard deviation measures the dispersion of the values of a dataset with respect to its mean. It is calculated using the formula:
If it is a sample, the following formula is used:
where:
are the values of the dataset.
is the mean of the dataset.
- n is the total number of observations.
- σ is the population standard deviation (when we have the entire population data).
- s is the sample standard deviation (when we have a sample and want to estimate the population’s dispersion).
- See Calculation in Python