Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
import pandas as pds = pd.Series([1, 2, 3, 3, 2, 1], dtype="category")
s0 1
1 2
2 3
3 3
4 2
5 1
dtype: category
Categories (3, int64): [1, 2, 3]s.sort_values()0 1
5 1
1 2
4 2
2 3
3 3
dtype: category
Categories (3, int64): [1, 2, 3]