🎙 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 4 of 10

In pandas 3, you change a filtered selection: toppers["cgpa"] = 10. What happens to the original df?

In pandas 3, you change a filtered selection: toppers["cgpa"] = 10. What happens to the original df?

  1. A.Nothing — only toppers changes (copy-on-write)
  2. B.df changes too
  3. C.pandas raises an error
  4. D.Both are deleted
Answer & explanation

Correct answer: Nothing — only toppers changes (copy-on-write)

Use df.loc[condition, "cgpa"] = value to change df.

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 →