← Quiz: Feature Engineering: all 10 questions
Quiz: Feature Engineering · Question 10 of 10
What does pd.cut(ages, bins=[0, 21, 25, 100], labels=["≤21", "22-25", "26+"]) do?
What does pd.cut(ages, bins=[0, 21, 25, 100], labels=["≤21", "22-25", "26+"]) do?
- A.Deletes ages above 25
- B.Groups each age into one of three labelled bands
- C.Scales ages to between 0 and 1
- D.One-hot encodes every distinct age
Answer & explanation
Correct answer: Groups each age into one of three labelled bands
Binning turns a number into ordered categories.
Can you get the rest right without peeking?
Take the timed Quiz: Feature Engineering quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →