home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 904446262

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/5732#issuecomment-904446262 https://api.github.com/repos/pydata/xarray/issues/5732 904446262 IC_kwDOAMm_X8416ME2 4160723 2021-08-24T08:43:07Z 2021-08-24T12:11:28Z MEMBER

I think a similar concern applies to .update. I find it surprising in the first place that a single mapping item ("foo") results in multiple mapping items ("foo", "x") in the returned xarray object.

That said, I agree that taking into account the (indexed) coordinates of the DataArray are important for alignment. The example below makes perfect sense:

```python

foo = xr.DataArray([1.0, 2.0, 3.0], coords={"x": [0, 1, 2]}, dims="x") ds = xr.Dataset(coords={"x": [2, 3, 4, 5]}) ds.update({"foo": foo}) <xarray.Dataset> Dimensions: (x: 4) Coordinates: * x (x) int64 2 3 4 5 Data variables: foo (x) float64 3.0 nan nan nan ```

I guess my concern is related to the (my?) slightly ambiguous view of the DataArray concept as a single array-like vs. a collection of data + coordinates.

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