pandas sort_index on strings is case-sensitive (uppercase first); key=str.lower sorts case-insensitively
@btw-aak▲ 5 net votes
Index ['b','B','a'].sort_index() -> ['B','a','b']; with key=lambda i:i.str.lower() -> ['a','b','B']. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.