issues: 394625579
This data as json
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
394625579 | MDU6SXNzdWUzOTQ2MjU1Nzk= | 2636 | open_mfdataset change the attributes of Coordinates | 30388627 | closed | 0 | 6 | 2018-12-28T12:24:01Z | 2018-12-29T23:47:42Z | 2018-12-29T23:47:42Z | NONE | Code Sample```python import xarray as xr import numpy as np from netCDF4 import Dataset temp = np.random.randn(2, 2, 3) precip = np.random.rand(2, 2, 3) lon = [[-99.83, -99.32], [-99.79, -99.23]] lat = [[42.25, 42.21], [42.63, 42.59]] attrs = {'units': 'hours since 2015-01-01'} ds_1 = xr.Dataset({'temperature': (['x', 'y', 'time'], temp)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': ('time', [100, 101, 102], attrs)}) ds_2 = xr.Dataset({'temperature': (['x', 'y', 'time'], temp+1)}, coords={'lon': (['x', 'y'], lon), 'lat': (['x', 'y'], lat), 'time': ('time', [200, 201, 202], attrs)}) ds_1.to_netcdf('ds1.nc') ds_2.to_netcdf('ds2.nc') ds = xr.open_mfdataset('ds*.nc') ds.to_netcdf('merge.nc') with xr.open_dataset('merge.nc') as f: print (f,'\n') print ('---------------------------') ds_1 = Dataset('ds1.nc') print ('keys of ds_1:') print (ds_1.variables.keys(),'\n') print ('time of ds_1:') print (ds_1.variables['time'],'\n') print ('---------------------------') merge = Dataset('merge.nc') print ('keys of merge:') print (merge.variables.keys(),'\n') print ('time of merge:') print (merge.variables['time'],'\n') ``` Problem descriptionAs Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2636/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |