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
https://github.com/pydata/xarray/issues/3240#issuecomment-524525841,https://api.github.com/repos/pydata/xarray/issues/3240,524525841,MDEyOklzc3VlQ29tbWVudDUyNDUyNTg0MQ==,2818208,2019-08-24T06:39:00Z,2019-08-24T06:39:00Z,CONTRIBUTOR,"@shoyer, maybe I am missing a nuance in your answer, but I think I already understand this bit about Xarray. My question was why is it is allowed to add a scalar:
```python
>>> arr = xr.DataArray(range(3), dims=['x'], coords={'x': list('abc')})
>>> arr.coords
Coordinates:
* x (x) >> arr.coords['y'] = 1 # <----------- Why does this work?
>>> arr.coords
Coordinates:
* x (x)