A skewed income column must be split into four groups of equal count. Which function does that, and what does the other do instead?
Correct answer
A. qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges
18 views
A. qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges
18 views
qcut bins by quantiles so each bin holds roughly the same number of observations, while cut bins on equal-width intervals of the value range. With skewed data, equal-width bins put almost everything in the first interval, which is why qcut suits ranking and cohort work. qcut raises when duplicate bin edges occur, fixed with duplicates='drop'.
Asked in: NTS, PPSC IT, Interviews
Not sure why the answer is A? Ask here and get an explanation.