-
-
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
Labeled repr #1044
Comments
Agreed, I'm never been really happy with our use of the NumPy repr for >2 dimensions. It's quite hard to match up the labels. Something like this would be a meaningful improvement! I would encourage experimentation on this. |
Good idea! I am in favor of as few repr as possible, i.e. maybe the first few values in each dimension. |
I think dupe of #680 |
After seeing the discussion in #680, I'm wondering if showing the firsts values of the flattened array wouldn't be enough here, e.g., something like this:
This example is more consistent with the repr of
|
I agree, but I see one or two cases where it could be useful to have the first few values for each dim. For example with geopotential data on pressure levels, it could be interesting to see how the data varies with height on the third dim. But this is a detail, not very important. |
There could be some display options exposed to manage this - for instance I personally would not like a flat array - but see how it could make sense. Additionally / alternatively, the repr I'm talking (small slice of values laid out with coordinate labels) could called something other than |
In most cases I found the To inspect the data of high dimensional datarrays, I've mainly used the indexing logic of xarray to extract slices of <3 dimensions. However, I admit that for quick inspection purposes I actually like your suggestion of having a specific repr method that would allow showing small data slices as labeled tables, especially if we choose to always use a flat array for the repr of >>> d.slice_repr(a=0, b=0)
d 0 1 2 3 4 5 6 7 8 9
c
J 0 1 2 3 4 5 6 7 8 9
K 10 11 12 13 14 15 16 17 18 19 This is equivalent to >>> dslice = d.isel(a=0, b=0)
>>> pd.DataFrame(data=dslice.data, index=dslice.c, columns=dslice.d) Except that |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity |
It may be nice to take advantage of labels to show a different, labeled repr - especially for more than 3 dimensions, I personally find the the numpy array one hard to read.
Some sample data and the current repr
The labeled repr could instead look something (not exactly) like this?
The text was updated successfully, but these errors were encountered: