home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 253649762

This data as json

html_url issue_url id node_id user created_at updated_at author_association body reactions performed_via_github_app issue
https://github.com/pydata/xarray/issues/1044#issuecomment-253649762 https://api.github.com/repos/pydata/xarray/issues/1044 253649762 MDEyOklzc3VlQ29tbWVudDI1MzY0OTc2Mg== 4160723 2016-10-13T21:52:46Z 2016-10-13T21:57:24Z MEMBER

In most cases I found the DataArray repr useful for quickly checking the dimensions (both names and sizes), the attributes and the types/values of both data and labels (I mean just checking here if the values are consistent regarding their units, acceptable ranges, etc.), but rarely for in-depth checking of the data values along each dimension, hence my suggestion of a flat (subset) array.

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 Dataarray (i.e., even when the number of dimensions <3). Why not something like:

``` python

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

``` python

dslice = d.isel(a=0, b=0) pd.DataFrame(data=dslice.data, index=dslice.c, columns=dslice.d) ```

Except that slice_repr() would return a string instead of a data object (or an array or a dataframe). Not sure about the name and/or signature of slice_repr(), though.

{
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  182638499
Powered by Datasette · Queries took 236.601ms · About: xarray-datasette