API: MultiIndex.labels -> codes (original) (raw)
The boat may have long sailed on this, but just for consideration.
I semi-frequently get the .levels and .labels of a MultiIndex backwards. Maybe it's just me, but I think labels is the culprit, because in other pandas contexts, "labels" refer to the actual value of the thing. E.g.
.locindexes by "labels" (values)- the values inside of a single row index or columns are the "labels" for those items
So, consistent with Categorical, would it make sense for the integer mapping inside a MultiIndex to also be called .codes?