1. Home
  2. Data Science
  3. Pandas
  4. A skewed income column must be split into four groups of…

Added 30 Nov -0001

A skewed income column must be split into four groups of equal count. Which function does that, and what does the other do instead?

  1. qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges Correct answer
  2. cut, which uses sample quantiles, whereas qcut splits on equal-width value ranges
  3. cut, because both functions are identical except for the naming of their labels
  4. qcut, because it always produces equal-width bins regardless of the data distribution

Correct answer

A. qcut, which uses sample quantiles, whereas cut splits on equal-width value ranges

18 views

MCQSEXAM

Explanation

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'.

Reference

Asked in: NTS, PPSC IT, Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Pandas MCQs

Practise all Pandas MCQs

Similar MCQs