issue_comments: 300381278
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/1391#issuecomment-300381278 | https://api.github.com/repos/pydata/xarray/issues/1391 | 300381278 | MDEyOklzc3VlQ29tbWVudDMwMDM4MTI3OA== | 6980561 | 2017-05-10T05:52:21Z | 2017-05-10T05:56:15Z | NONE | I have an example that I just struggled through that might be relevant to this idea. I'm running a point model using some arbitrary number of experiments (for the below example there are 28 experiments). Each experiment is opened and then stored in a dictionary ``` resultsDataSet = xr.Dataset() for k in scalar_data_vars: if not 'scalar' in k: continue
print(resultsDataSet)
And here is a helper function that can do this more generally, which I wrote a while back. ``` def combinevars(ds_in, dat_vars, new_dim_name='new_dim', combinevarname='new_var'): ds_out = xr.Dataset() ds_out = xr.concat([ds_in[dv] for dv in dat_vars], dim='new_dim') ds_out = ds_out.rename({'new_dim': new_dim_name}) ds_out.coords[new_dim_name] = dat_vars ds_out.name = combinevarname
``` |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
225536793 |