What does the copy() method do, and what is the difference between a deep and shallow copy?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: medium
Interview Round: Other
Overview: Asks what the pandas copy() method does and how a deep copy differs from a shallow copy of a DataFrame or Series. Tests understanding of shared data, mutable objects in object columns, views, SettingWithCopyWarning and Copy-on-Write.