-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataArrays should display their coordinates in the natural order #712
Comments
I think this may have been fixed by the recent rewrite of DataArray internals. On master, I have:
|
Awesome, thanks. Any plans for a release soon? |
yes, in the next week, hopefully. |
This should be fixed in v0.7.0... please reopen if it resurfaces. |
Requesting a reopen: this issue is present again in 0.7.2. |
OK, I didn't read your first post carefully last time. Your complaint was about the order of coordinates in We could add some sort of ad-hoc adjustment to the order in which we display coordinates, but I'm reluctant because it's not obvious to me what that "correct" order would be. For example, that you can directly supply the I suppose once principled choice would always be to display coordinates corresponding to dimensions first in lists of coordinates, and to always display them in the same order as dimensions. If we do this, it should be consistent between both DataArray and Dataset. |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity |
The issue is still relevant. For the record, the repro code is now (e.g.)
|
@anntzer - would you be interested in working on this? |
I don't know anything about the internals of xarray, and to be honest I rarely use it anymore. |
what should we do about this? We did touch the subject in #4409, but decided to keep the order the coordinates were passed in rather than sorting by dimension (or alphabetically). I think there's a lot of confusion about the difference between the dimensions in the summary line of A fix for #4515 might make sorting by dimension order much more important. |
#4515 is consistent with this comment up above:
|
true, it seems I didn't read this issue carefully enough |
Consider
This outputs
I understand that internally both DataArrays use the same coords object and thus the same coords order, but it would be helpful if, when printing d2 by itself, the coordinates were printed in the natural order ("bar", "foo"). In particular, when working interactively, the list of coordinates at the end of the repr is the most easy thing to spot, and thus most helpful to know how to format the call to
array.loc[...]
.The text was updated successfully, but these errors were encountered: