Closed
Description
It would be really nice if there was a sort=False
option on stack/unstack and pivot. (Preferably the default)
It is reasonably common to have data in non-standard order that actually provides information (in my case, I have model names, and the order of the names denotes complexity of the models). Stacking or unstacking currently loses all of this information, with no way to retrieve it. That does not seem like a sensible default to me.
It would be relatively easy to work around a non-sorted stack/unstack method (using .sort_index). To go the other way is less trivial, requiring the user to store a list of the values in the necessary order.
I actually find it hard to think of a situation where a sort on unstack would be more useful...