Grouping by two columns gives a MultiIndex: each row label is a pair, like ("East", "Lighting").
s.loc["East"] selects by the outer level and drops it.
s.loc[("East", "Lighting")] selects one exact pair.
s.xs("Lighting", level="category") selects by the inner level, which loc can't do directly.
s.swaplevel() swaps the levels; follow with sort_index() to group the new outer level together.
reset_index() turns the levels back into ordinary columns, often the easiest fix.
Columns can have two levels too: agg({"revenue": ["sum", "mean"]}) gives columns like ("revenue", "sum"). Flatten them into single names with a list comprehension: t.columns = ["_".join(c) for c in t.columns].