home / github / issues

Menu
  • Search all tables
  • GraphQL API

issues: 405244302

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
405244302 MDU6SXNzdWU0MDUyNDQzMDI= 2731 Can't access variables in the subgroup 30388627 closed 0     1 2019-01-31T13:24:51Z 2019-01-31T21:57:57Z 2019-01-31T21:57:57Z NONE      

Code Sample

```python import xarray as xr from netCDF4 import Dataset

rootgrp = Dataset("test.nc", "w", format="NETCDF4") fcstgrp = rootgrp.createGroup("forecasts")

lat = rootgrp.createDimension("lat", 73) lon = rootgrp.createDimension("lon", 144) latitudes = rootgrp.createVariable("lat","f4",("lat",)) longitudes = rootgrp.createVariable("lon","f4",("lon",))

temp = rootgrp.createVariable("temp","f4",("lat","lon",)) ftemp = rootgrp.createVariable("/forecasts/temp","f4","lat","lon",) rootgrp.close()

ds = xr.open_dataset('test.nc') print (ds['temp']) print (ds['/forecasts/temp']) ```

Problem description

The temp variable in the / group can be accessed successfully, but temp in the /forecasts group not. It says: KeyError: '/forecasts/temp'

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.8.final.0 python-bits: 64 OS: Linux OS-release: 4.9.0-8-amd64 machine: x86_64 processor: byteorder: little LC_ALL: None LANG: en_US.utf8 LOCALE: en_US.UTF-8 xarray: 0.11.0 pandas: 0.23.4 numpy: 1.15.4 scipy: 1.1.0 netCDF4: 1.4.2 h5netcdf: 0.5.1 h5py: 2.8.0 Nio: None zarr: None cftime: 1.0.0 PseudonetCDF: None rasterio: None iris: 2.2.0 bottleneck: 1.2.1 cyordereddict: None dask: 0.16.1 distributed: 1.20.2 matplotlib: 3.0.2 cartopy: 0.17.0 seaborn: 0.8.1 setuptools: 38.4.0 pip: 18.1 conda: 4.6.1 pytest: 3.3.2 IPython: 6.2.1 sphinx: 1.6.6
{
    "url": "https://api.github.com/repos/pydata/xarray/issues/2731/reactions",
    "total_count": 0,
    "+1": 0,
    "-1": 0,
    "laugh": 0,
    "hooray": 0,
    "confused": 0,
    "heart": 0,
    "rocket": 0,
    "eyes": 0
}
  completed 13221727 issue

Links from other tables

  • 2 rows from issues_id in issues_labels
  • 1 row from issue in issue_comments
Powered by Datasette · Queries took 0.931ms · About: xarray-datasette