Which statistical function of pandas is used to display the average of squared differences from the mean?
Which statistical function of pandas is used to display the average of squared differences from the mean?
Solution
✅ Correct Option: 4
DataFrame.var() returns the variance, which is the average of the squared differences from the mean. By default pandas divides by (sample variance, ddof=1).
Option 1: std() is the square root of the variance, so it is in the original units of the data and is not the average of squared differences.
Option 2: describe() gives a summary (count, mean, std, min, quartiles, max), not the variance itself.
Option 3: quantile() returns values at given percentiles (default 0.5, the median), which has nothing to do with squared differences.
Related questions:
2025: 13 May Shift 2
2025: 3 June Shift 2