The correct answer is C. sort_values().
The sort_values() method is used to sort a DataFrame by the values in one or more columns in ascending or descending order. The method takes two arguments: the column(s) to sort by and the order (ascending or descending).
For example, to sort a DataFrame by the values in the A
column in ascending order, you would use the following code:
df.sort_values('A', ascending=True)
To sort a DataFrame by the values in the A
and B
columns in descending order, you would use the