In pandas, what is the difference between rename() and setting df.columns directly?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks how renaming columns with the pandas rename method differs from assigning a new list to df.columns. Tests understanding of how labels are matched, whether the DataFrame is changed or copied, and what happens with missing names, wrong lengths and duplicate columns.