home / github / issue_comments

Menu
  • Search all tables
  • GraphQL API

issue_comments: 524617139

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/3240#issuecomment-524617139 https://api.github.com/repos/pydata/xarray/issues/3240 524617139 MDEyOklzc3VlQ29tbWVudDUyNDYxNzEzOQ== 2818208 2019-08-25T10:02:39Z 2019-08-25T10:02:39Z CONTRIBUTOR

I see. This is because coordinates are just DataArray objects. So

```python

arr.coords['y'] = range(3) ```

is equivalent to

```python

new_coords = xr.DataArray(data=range(3)) arr.coords['y'] = new_coords ```

And the reason this is a ValueError is that new_coords has a default dimension dim_0 that is not on arr. However, this

```python

arr.coords['y'] = 1 ```

is equivalent to...

```python

new_coords = xr.DataArray(data=1, dims=[]) arr.coords['y'] = new_coords ```

And new_coords has no dimensions that are not on arr.

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