Pandas xs: Using the `level` argument with an int or a name

Pandas xs: Using the `level` argument with an int or a name

Using xs to retrieve from a Python Pandas multi-index? “level” takes an int or string:

– int: The index level, with 0 the outermost
– string: The level’s name — but not every level has one

The name is clearer, but sometimes harder to type.