Two columns can share a center and still behave very differently. Spread measures how far values sit from the center:
- The standard deviation (SD) is the typical distance from the mean, in the column's own units. For a sample it divides by n - 1, not n. pandas
.std() does this by default; np.std() divides by n unless you pass ddof=1.
- The variance is the SD squared, in squared units, which is why people report the SD.
- The interquartile range (IQR) is the distance between the 25th and 75th percentiles: the middle half of the data. Outliers barely move it.
- The coefficient of variation divides the SD by the mean, so you can compare spread between things on different scales.
Use the SD for roughly symmetric data and the IQR for skewed data with outliers.
The sample SD and the IQR.