How do you sort a pandas DataFrame by column values or by index?
Role: Data Scientist
Category: Data Manipulation (SQL/Python)
Difficulty: easy
Interview Round: Other
Overview: Asks how to sort a pandas DataFrame by one or more columns or by its index labels. It tests knowledge of sort_values and sort_index, per-column sort direction, missing value placement, custom category orders and what happens to the index after sorting.