home / github / issues

Menu
  • GraphQL API
  • Search all tables

issues: 125708367

This data as json

id node_id number title user state locked assignee milestone comments created_at updated_at closed_at author_association active_lock_reason draft pull_request body reactions performed_via_github_app state_reason repo type
125708367 MDU6SXNzdWUxMjU3MDgzNjc= 712 DataArrays should display their coordinates in the natural order 1322974 open 0     13 2016-01-08T22:33:05Z 2020-11-06T18:48:54Z   CONTRIBUTOR      

Consider

``` from collections import * import numpy as np from xray import *

d1 = DataArray(np.empty((2, 2)), coords=OrderedDict([("foo", [0, 1]), ("bar", [0, 1])])) d2 = DataArray(np.empty((2, 2)), coords=OrderedDict([("bar", [0, 1]), ("foo", [0, 1])]))

ds = Dataset({"d1": d1, "d2": d2})

print(ds.d1) print(ds.d2) ```

This outputs

<xray.DataArray 'd1' (foo: 2, bar: 2)> array([[ 6.91516848e-310, 1.64244654e-316], [ 6.91516881e-310, 6.91516881e-310]]) Coordinates: * foo (foo) int64 0 1 * bar (bar) int64 0 1 <xray.DataArray 'd2' (bar: 2, foo: 2)> array([[ 1.59987863e-316, 6.91516883e-310], [ 6.91515690e-310, 2.12670320e-316]]) Coordinates: * foo (foo) int64 0 1 * bar (bar) int64 0 1

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[...].

{
    "url": "https://api.github.com/repos/pydata/xarray/issues/712/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
    13221727 issue

Links from other tables

  • 0 rows from issues_id in issues_labels
  • 13 rows from issue in issue_comments
Powered by Datasette · Queries took 0.48ms · About: xarray-datasette