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/277#issuecomment-595750013,https://api.github.com/repos/pydata/xarray/issues/277,595750013,MDEyOklzc3VlQ29tbWVudDU5NTc1MDAxMw==,2448579,2020-03-06T12:38:07Z,2020-03-06T12:38:07Z,MEMBER,Should have been closed by #3159 ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-491231541,https://api.github.com/repos/pydata/xarray/issues/277,491231541,MDEyOklzc3VlQ29tbWVudDQ5MTIzMTU0MQ==,2418513,2019-05-10T09:52:35Z,2019-05-10T09:53:36Z,NONE,"It might also make sense then to implement all numpy-like constructors for `DataArray`, plus the `empty()`, which is typically faster for larger arrays:
- `.full()` (kind of what's suggested here)
- `.ones()`
- `.zeros()`
- `.empty()`
This should be trivial to implement.","{""total_count"": 9, ""+1"": 9, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-472176709,https://api.github.com/repos/pydata/xarray/issues/277,472176709,MDEyOklzc3VlQ29tbWVudDQ3MjE3NjcwOQ==,1217238,2019-03-12T20:53:40Z,2019-03-12T20:53:40Z,MEMBER,This hasn't been implemented yet (but would still be welcome!),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-472156039,https://api.github.com/repos/pydata/xarray/issues/277,472156039,MDEyOklzc3VlQ29tbWVudDQ3MjE1NjAzOQ==,23265127,2019-03-12T19:53:21Z,2019-03-12T19:53:21Z,NONE,"Hi, I am also looking for a solution to create an ""empty"" xarray (filled with some default value, say, 0 or NaN) whose size gets automatically determined by its coordinates (which are passed to the DataSet constructor as a dict). Has there been any progress since the original post by andreas-h?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-454168764,https://api.github.com/repos/pydata/xarray/issues/277,454168764,MDEyOklzc3VlQ29tbWVudDQ1NDE2ODc2NA==,16394078,2019-01-14T21:30:30Z,2019-01-14T22:44:23Z,NONE,This seems too fundamental a feature to close unresolved. I am sure others will encounter the same need and will create duplicate issues. ,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-454164162,https://api.github.com/repos/pydata/xarray/issues/277,454164162,MDEyOklzc3VlQ29tbWVudDQ1NDE2NDE2Mg==,5635139,2019-01-14T21:15:43Z,2019-01-14T21:15:43Z,MEMBER,"In an effort to reduce the issue backlog, I'll close this, but please reopen if you disagree","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-275979038,https://api.github.com/repos/pydata/xarray/issues/277,275979038,MDEyOklzc3VlQ29tbWVudDI3NTk3OTAzOA==,1562854,2017-01-30T04:42:12Z,2017-01-30T04:42:12Z,CONTRIBUTOR,"OK, great! I figured it out. Something like the below works; @rabernat had pointed to a similar solution, but I didn't quite understand what `dask.array.map_blocks` was doing.
```
import xmitgcm
import xarray as xr
data = xmitgcm.open_mdsdataset(dirname='./',prefix={'T'},iters=12600,read_grid=True,geometry='cartesian',endian='<',
chunks={'Z':1,'time':1})
def interpolateAtDepth(T,x0,y0,x,y):
import scipy.interpolate
if np.shape(T)[-1]>1:
xout=np.zeros((1,1,ny,nx))
fit=scipy.interpolate.RectBivariateSpline(x0,y0,T[0,0,:,:].T)
xout = fit(x,y).T
else:
xout=np.ones((1,1,1,1))
return xout
# x, y, nx, ny are determined elsewhere, but set the new grid...
tm = data['T'].data.map_blocks(interpolateAtDepth,data['XC'].values,data['YC'].values,x,y,chunks=(1,1,ny,nx))
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-275958974,https://api.github.com/repos/pydata/xarray/issues/277,275958974,MDEyOklzc3VlQ29tbWVudDI3NTk1ODk3NA==,1217238,2017-01-30T00:29:51Z,2017-01-30T00:29:51Z,MEMBER,"> Given the dask integration, being able to initialize DataArrays that are chunked would be very helpful. I want to map from an old x-y-z grid to a new one, and theoretically it could be too memory intensive to keep the new grid in memory, so it would be nice to initialize an empty one and then fill it.
Dask Array recently added support for modifying arrays in place but generally this isn't recommended -- you want to create new arrays, e.g., with `dask.array.atop` or `map_blocks`.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-275776968,https://api.github.com/repos/pydata/xarray/issues/277,275776968,MDEyOklzc3VlQ29tbWVudDI3NTc3Njk2OA==,1562854,2017-01-27T21:17:57Z,2017-01-27T21:17:57Z,CONTRIBUTOR,"Given the `dask` integration, being able to initialize DataArrays that are chunked would be very helpful. I want to map from an old x-y-z grid to a new one, and theoretically it could be too memory intensive to keep the new grid in memory, so it would be nice to initialize an empty one and then fill it. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-67812697,https://api.github.com/repos/pydata/xarray/issues/277,67812697,MDEyOklzc3VlQ29tbWVudDY3ODEyNjk3,1217238,2014-12-22T08:26:09Z,2014-12-22T08:26:09Z,MEMBER,"Fixed the doc string for now, but this would still be a nice feature to add at some point.
","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141
https://github.com/pydata/xarray/issues/277#issuecomment-62440542,https://api.github.com/repos/pydata/xarray/issues/277,62440542,MDEyOklzc3VlQ29tbWVudDYyNDQwNTQy,1217238,2014-11-10T19:33:50Z,2014-11-10T19:33:50Z,MEMBER,"This is definitely a case where the documentation has gotten out of sync with the implementation (I used to abuse a `dataset` argument in `DataArray.__init__` for a fastpath constructor, but now I have another method for that). The `data` argument is not really optional right now (unless you want a scalar DataArray containing the value `None`).
Your proposed functionality does sound useful. Do you want to take a crack at the implementation? The init logic for DataArray is pretty self contained, and it's all at the top of `xray/core/dataarray.py`. It will require a small amount of reorganization because `_infer_coords_and_dims` currently assumes it already knows the shape of the data.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,48301141