Not able to change direction of sort on per column basis for DataFrame · Issue #928 · pandas-dev/pandas (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
The sort
method on DataFrame supports sorting by multiple columns, yet only supports sorting in one direction (ascending or descending). It would be great to specify this. Perhaps something like this: df.sort(columns=['Name|descending', 'Age']
which would sort name first in descending order and then where names match use ascending order.
Also I see no mention of whether the sort is stable. If it is, this can be replicated by multiple sort calls.