home / github / issue_comments

Menu
  • GraphQL API
  • Search all tables

issue_comments: 610077592

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/3819#issuecomment-610077592 https://api.github.com/repos/pydata/xarray/issues/3819 610077592 MDEyOklzc3VlQ29tbWVudDYxMDA3NzU5Mg== 2448579 2020-04-06T22:52:41Z 2020-04-06T22:52:41Z MEMBER

There is a subtle error here:

```

grid['sea_surface_temperature'].expand_dims('time', axis=0) <xarray.DataArray 'sea_surface_temperature' (time: 1, lat: 160, lon: 360)> array([[[1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], ..., [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.], [1., 1., 1., ..., 1., 1., 1.]]]) Coordinates: * lat (lat) int64 -80 -79 -78 -77 -76 -75 -74 ... 73 74 75 76 77 78 79 * lon (lon) int64 -180 -179 -178 -177 -176 -175 ... 175 176 177 178 179 Dimensions without coordinates: time ```

time is added as an unindexed dimension with no encoding or attrs dicts. This is because once you pull the DataArray sea_surface_temperature out of the dataset; the time variable in the dataset is not attached to that DataArray (since it doesn't have a time dimension).

When the expanded dataarray is assigned back to the dataset, we run into #2180

The only solution I could find is grid["sea_surface_temperature"] = grid.sea_surface_temperature.expand_dims("time", axis=0).assign_coords(time=grid.time)

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