issue_comments: 427892990
This data as json
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/2159#issuecomment-427892990 | https://api.github.com/repos/pydata/xarray/issues/2159 | 427892990 | MDEyOklzc3VlQ29tbWVudDQyNzg5Mjk5MA== | 35968931 | 2018-10-08T16:12:06Z | 2018-10-08T16:12:06Z | MEMBER | Thanks @shoyer for the description of how this should be done properly. In the meantime however, I thought I would describe how I solved the problem in my last comment. My method works but you probably wouldn't want to use it in xarray itself because it's pretty "hacky". To avoid the issue of numpy reading the
def _concat_nd(obj_grid, concat_dims=None, data_vars=None, kwargs): # Combine datasets along one dimension at a time, # Have to start with last axis and finish with axis=0 otherwise axes will disappear before the loop reaches them for axis in reversed(range(obj_grid.ndim)): obj_grid = np.apply_along_axis(_concat_dicts, axis, arr=obj_grid, dim=concat_dims[axis], data_vars=data_vars[axis], kwargs)
def _concat_dicts(dict_objs, dim, data_vars, kwargs): objs = [dict_obj['key'] for dict_obj in dict_objs] return {'key': concat(objs, dim, data_vars, kwargs)} ``` In case anyone is interested then this is how I've (hopefully temporarily) solved the N-D concatenation problem in the case of my data. |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
324350248 |