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/2710#issuecomment-589133779,https://api.github.com/repos/pydata/xarray/issues/2710,589133779,MDEyOklzc3VlQ29tbWVudDU4OTEzMzc3OQ==,10720577,2020-02-20T15:35:22Z,2020-02-20T15:35:22Z,CONTRIBUTOR,"Yes, @TomNicholas. My PR got merged but I forgot to close the issue -- closing it now. Thanks for checking. ","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,403326458
https://github.com/pydata/xarray/issues/2710#issuecomment-485544371,https://api.github.com/repos/pydata/xarray/issues/2710,485544371,MDEyOklzc3VlQ29tbWVudDQ4NTU0NDM3MQ==,10720577,2019-04-22T20:39:17Z,2019-04-22T20:39:17Z,CONTRIBUTOR,"> Another solution could be adding support for `da.sel(dim1='a', squeeze=False)` to avoid losing the `dim1` dimension/coordinate in the first place

Or equivalently, you could just do
```
da.sel(dim1=['a'])
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,403326458
https://github.com/pydata/xarray/issues/2710#issuecomment-458730514,https://api.github.com/repos/pydata/xarray/issues/2710,458730514,MDEyOklzc3VlQ29tbWVudDQ1ODczMDUxNA==,10720577,2019-01-29T22:19:58Z,2019-01-29T22:19:58Z,CONTRIBUTOR,"Oh I see what you're saying. Yeah, that makes sense.

To get the equivalent of `da.expand_dims(a=[9, 10, 11])`, you'd do
```
>>> new = da.expand_dims(a=3)
>>> new
<xarray.DataArray (a: 3, b: 5, c: 3)>
...
Coordinates:
  * b        (b) int64 0 1 2 3 4
  * c        (c) int64 0 1 2
Dimensions without coordinates: a
>>> new[""a""] = [9, 10, 11]
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,403326458
https://github.com/pydata/xarray/issues/2710#issuecomment-458638827,https://api.github.com/repos/pydata/xarray/issues/2710,458638827,MDEyOklzc3VlQ29tbWVudDQ1ODYzODgyNw==,10720577,2019-01-29T17:49:55Z,2019-01-29T17:49:55Z,CONTRIBUTOR,"Those _would_ be equivalent, I think, assuming they're both manipulating the same `da` object (I meant for them to be separate calls not sequential, but even if they were sequential, `expand_dims` doesn't and wouldn't alter `da`, but instead return a new xarray object). I edited my above post to clarify what `da` is.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,403326458
https://github.com/pydata/xarray/issues/2710#issuecomment-458609172,https://api.github.com/repos/pydata/xarray/issues/2710,458609172,MDEyOklzc3VlQ29tbWVudDQ1ODYwOTE3Mg==,10720577,2019-01-29T16:32:36Z,2019-01-29T17:44:25Z,CONTRIBUTOR,"Hi,
Thanks for replying. I see what you mean about the 2 separate features.

Would it be alright if I opened a PR sometime soon that upgraded `expand_dims` to support the inserting/broadcasting dimensions with size > 1 (the first feature)?

I would use your suggested API, i.e. not requiring explicit coordinate names -- that makes sense. However, it feels like the dimension kwargs (i.e. the new dimension/dimensions), should be allowed to be given implicit or explicit coordinates, in case the user doesn't want 0-based integer coordinates for the new dimension. For example,
```
da.expand_dims(a=3)
```
is equivalent to
```
da.expand_dims(a=[0, 1, 2])   
```
but this will also work
```
da.expand_dims(a=['w', 'x', 'y', 'z'])
```
where `da` is
```
>>> coords = {""b"": range(5), ""c"": range(3)}
>>> da = xr.DataArray(np.ones([5, 3]), coords=coords, dims=list(coords.keys()))
>>> da
<xarray.DataArray (b: 5, c: 3)>
array([[1., 1., 1.],
       [1., 1., 1.],
       [1., 1., 1.],
       [1., 1., 1.],
       [1., 1., 1.]])
Coordinates:
  * b        (b) int64 0 1 2 3 4
  * c        (c) int64 0 1 2
````
Does that make sense?

Thank you!
Martin","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,403326458