Standard Deviation & Variance in Python
Std Dev & Variance
Variance
Average squared distance from the mean. Units are squared (awkward to interpret).
Standard Deviation
Square root of variance. Same units as the data — easier to interpret.
Bell Curve Reference
~68% of data within ±1 SD of mean, ~95% within ±2 SD, ~99.7% within ±3 SD.
Python Code
import statistics; statistics.stdev(data) for sample SD, statistics.pstdev(data) for population.
Noble Desktop's Python Programming Immersive covers AI APIs, data analysis, and modern Python development.
Now that we discussed mean, median, and mode – let’s discuss a topic that is a bit more complex but is frequently used in finance, health, and many other sectors. The standard deviation or variance, the standard deviation is just the variance square rooted or raised to ½. The standard deviation is more commonly used, and it is a measure of the dispersion of the data. This is very different from the mean, median which gives us the “middle” of our data, also known as the average.


