The discreteness of data measures how spread out a set of data is. There are many standards and methods to measure this spread, and the choice of a specific method depends on the specific data requirements.
Range (极差)
It’s the most simple one among all the methods. It reflects the range of samples.
Interquartile (IQR, 四分位差)
IQR represents the range between the 75th percentile data (Q3) and the 25th percentile data (Q1) in the dataset. It reflects the range of the central 50% of the data.
Mean Deviation (平均差)
The sum of absolute differences between each variable value and the mean, divided by the total count n, the mean deviation with the mean as the center, comprehensively and accurately reflects the discreteness of a dataset.
Variance/Standard Deviation/Coefficient of Variation (方差/标准差/离散系数)
1 | import numpy as np |