← Quiz: Data Cleaning: all 10 questions
Quiz: Data Cleaning · Question 1 of 10
A CGPA column contains "six" among numbers. What safely converts it?
A CGPA column contains "six" among numbers. What safely converts it?
- A.df["cgpa"].astype(float)
- B.pd.to_numeric(df["cgpa"], errors="coerce")
- C.df["cgpa"].fillna(0)
- D.df.drop("cgpa")
Answer & explanation
Correct answer: pd.to_numeric(df["cgpa"], errors="coerce")
Bad values become NaN instead of crashing; then inspect them.
Can you get the rest right without peeking?
Take the timed Quiz: Data Cleaning quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →