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/742#issuecomment-226486770,https://api.github.com/repos/pydata/xarray/issues/742,226486770,MDEyOklzc3VlQ29tbWVudDIyNjQ4Njc3MA==,4304478,2016-06-16T13:36:28Z,2016-06-16T13:37:44Z,NONE,"Something akin to the pandas dataframe `update` would have value - then you could create an empty array structure and populate it as necessary: ``` python import pandas as pd df = pd.DataFrame(index=range(5), columns=['a','b','c','d']) df2 = pd.DataFrame(index=range(3), columns=['a'], data=range(3)) df.update(df2) ``` ``` a b c d 0 0 NaN NaN NaN 1 1 NaN NaN NaN 2 2 NaN NaN NaN 3 NaN NaN NaN NaN 4 NaN NaN NaN NaN ``` But, not sure if empty array construction is supported? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,130753818 https://github.com/pydata/xarray/issues/742#issuecomment-226003087,https://api.github.com/repos/pydata/xarray/issues/742,226003087,MDEyOklzc3VlQ29tbWVudDIyNjAwMzA4Nw==,4304478,2016-06-14T20:18:11Z,2016-06-14T20:18:11Z,NONE,"I'm having a similar issue, expanding the complexity in that I want to concatenate across multiple dimensions. I'm not sure if that's a cogent way to explain it, but here's an example. I have: ``` python m = xr.DataArray(data=[[[1.1, 1.2, 1.3]]], coords={'Dim1': ['A', 'B', 'C'], 'Dim2':['D'], 'Dim3':['F']}) n = xr.DataArray(data=[[[2.1, 2.2, 2.3]]], coords={'Dim1': ['A', 'B', 'C'], 'Dim2':['E'], 'Dim3':['F']}) o = xr.DataArray(data=[[[3.1, 3.2, 3.3]]], coords={'Dim1': ['A', 'B', 'C'], 'Dim2':['D'], 'Dim3':['G']}) p = xr.DataArray(data=[[[4.1, 4.2, 4.3]]], coords={'Dim1': ['A', 'B', 'C'], 'Dim2':['E'], 'Dim3':['G']}) ``` Which I want to merge into a single, fully populated array similar to what I'd get if I did: ``` python data =[[[ 1.1, 1.2, 1.3], [ 3.1, 3.2, 3.3]], [[ 2.1, 2.2, 2.3], [ 4.1, 4.2, 4.3]]] xr.DataArray(data=data, coords={'Dim1': ['A', 'B', 'C'], 'Dim2':['D', 'E'], 'Dim3':['F', 'G']}) ``` i.e. ``` python array([[[ 1.1, 1.2, 1.3], [ 3.1, 3.2, 3.3]], [[ 2.1, 2.2, 2.3], [ 4.1, 4.2, 4.3]]]) Coordinates: * Dim2 (Dim2) |S1 'D' 'E' * Dim3 (Dim3) |S1 'F' 'G' * Dim1 (Dim1) |S1 'A' 'B' 'C' ``` @jcmgray's function is pretty close, although the array indicies are described slightly differently (I'm not sure if this is a big deal or not...). Note the 'object' type for Dim2 and Dim3: ``` python array([[[ 1.1, 1.2, 1.3], [ 3.1, 3.2, 3.3]], [[ 2.1, 2.2, 2.3], [ 4.1, 4.2, 4.3]]]) Coordinates: * Dim2 (Dim2) object 'D' 'E' * Dim3 (Dim3) object 'F' 'G' * Dim1 (Dim1) |S1 'A' 'B' 'C' ``` It would be great to have a canonical way to do this. What should I try? ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,130753818