-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue
Milestone
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).
Metadata
Metadata
Assignees
Labels
AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffNeeds TestsUnit test(s) needed to prevent regressionsUnit test(s) needed to prevent regressionsgood first issue