Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

import pandas as pd
s = pd.Series([1, 2, 3, 3, 2, 1], dtype="category")
s
0 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]