home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 1546028265

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/pull/7840#issuecomment-1546028265 https://api.github.com/repos/pydata/xarray/issues/7840 1546028265 IC_kwDOAMm_X85cJoTp 14808389 2023-05-12T16:56:23Z 2023-05-12T16:56:23Z MEMBER

let's have a look at what defines the object: python data = xr.DataArray(np.random.randn(2, 3), dims=("x", "y"), coords={"x": [10, 20]}) That means we have: - random data - two dimensions: x with a length of 2 and y with a length of 3 - one coordinate: x with values [10, 20]

The line python data.x.attrs["units"] = "x units" can be split into two parts: python x = data.x and python x.attrs["units"] = "x units" where x is the coordinate.

If we did the same thing with y we would not get the dimension, but a dummy coordinate that has the values np.arange(data.sizes["y"]). This is admittedly a bit confusing.

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