Closed
Description
Code Sample
import pandas as pd
s = pd.Series([1, 2, 1, 3], ['first', 'b', 'second', 'c'])
print(s.sort_values(ascending=False, kind='mergesort'))
Output
c 3
b 2
second 1
first 1
dtype: int64
Expected Output
c 3
b 2
first 1
second 1
dtype: int64
Problem description
Mergesort should be stable irrespective of direction, but ascending=False
(which is not stable) is just the reverse of ascending=True
(which is stable).