Skip to content

Is there a way to reorder Dataset dimensions to match the DataArrays? #4649

Answered by keewis
ahuang11 asked this question in Q&A
Discussion options

You must be logged in to vote

sorry for the late reply, @ahuang11.

To me the the name SortedKeysDict implies that it is sorted, not ordered (the difference being that – similar to a OrderedDict – "ordered" follows the order of insertion while "sorted" is sorted somehow, in this case alphabetically).

The difficulty with Dataset dimensions is that the order has no actual meaning: consider a Dataset with three variables, one with the dimensions ("x", "y"), the second ("x", "t") and the other ("z", "t"). Which order should we use for those?

In order to completely avoid that somewhat complex decision, the Dataset dimensions are always sorted alphabetically, while for DataArray (or the semi-internal Variable) the order does…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahuang11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants