id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 159536177,MDU6SXNzdWUxNTk1MzYxNzc=,878,Allow passing a default value (instead of ndarray) for data argument for DataArray,1063143,closed,0,,,3,2016-06-10T00:18:12Z,2019-08-26T20:36:36Z,2019-08-26T20:36:36Z,NONE,,,,"Hi, First of all, thanks a lot for the amazing module. It seems when I create a DataArray, I have to pass a numpy.ndarray with a correct size for the `data` argument. It works well when I already have some data, but sometimes I want to create an ""empty"" DataArray with known coordinates and fill up the data later. For these cases, it would be great if xarray allows passing just a value for the `data` argument, and fill up all the elements of the array with the value. For example, with pandas, I can do: ``` python import pandas as pd test = pd.DataFrame(data=.1, index=range(100), columns=['col1', 'col2']) ``` and the resulting `DataFrame` would be: ``` python col1 col2 0 0.1 0.1 1 0.1 0.1 2 0.1 0.1 .. ... ... 97 0.1 0.1 98 0.1 0.1 99 0.1 0.1 [100 rows x 2 columns] ``` Thanks a lot! ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/878/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue 173494017,MDU6SXNzdWUxNzM0OTQwMTc=,987,Return a scalar instead of DataArray when the return value is a scalar,1063143,closed,0,,,11,2016-08-26T16:37:36Z,2016-08-28T20:19:19Z,2016-08-28T20:19:19Z,NONE,,,,"Hi, I'm not sure how devs will feel about this, but I wanted to ask because I'm getting into this issue frequently. Currently many methods such as `.min()`, `.max()`, `.mean()` returns a DataArray even for the cases where the return value is a scaler. For example, ``` python import numpy as np import xarray as xr test = xr.DataArray(data=np.ones((10, 10))) In [6]: test.min() Out[6]: array(1.0) ``` which makes a lot of other things break down and I have to use `test.min().values` or `float(test.min())`. I think it would be great that these methods return a scalar when the return value is a scaler. For example, ``` python In [7]: np.ones((10, 10)).mean() Out[7]: 1.0 ``` Thank you! ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/987/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,completed,13221727,issue