🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.df["cgpa"].astype(float)
  2. B.pd.to_numeric(df["cgpa"], errors="coerce")
  3. C.df["cgpa"].fillna(0)
  4. 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 →