← 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?
- A.Nothing — only toppers changes (copy-on-write)
- B.df changes too
- C.pandas raises an error
- 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 →