What does ser.value_counts(normalize=True, dropna=False) return?
Correct answer
D. Relative frequencies per distinct value, including NaN as its own category, summing to 1
16 views
D. Relative frequencies per distinct value, including NaN as its own category, summing to 1
16 views
value_counts options: normalize=True divides counts by the total to give proportions, and dropna=False counts missing values as their own entry, which matters when the missing rate is the question. The defaults are dropna=True and sort=True, giving descending absolute counts. Because NaN is counted as a category, the returned proportions still sum to 1.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is D? Ask here and get an explanation.