Skip to content

Dataset.to_netcdf() cannot create group with engine="h5netcdf" #2177

Closed
@Hoeze

Description

@Hoeze

Code Sample, a copy-pastable example if possible

import pandas as pd
import numpy as np
import xarray as xr

sample_data = np.random.uniform(size=[2,2000,10000])
x = xr.Dataset({"sample_data": (("x", "y", "z"), sample_data)})

df = pd.DataFrame({"x": [1,2,3], "y": [2,4,6]})
x["df"] = df
print(x)

# not working:
x.to_netcdf("test.h5", group="asdf", engine="h5netcdf")
# working:
x.to_netcdf("test.h5", group="asdf", engine="netcdf4")

grafik

Problem description

h5netcdf does not allow creating groups

Expected Output

should save data to "test.h5"

Output of xr.show_versions()

INSTALLED VERSIONS ------------------ commit: None python: 3.6.5.final.0 python-bits: 64 OS: Linux OS-release: 4.16.9-1-ARCH machine: x86_64 processor: byteorder: little LC_ALL: None LANG: de_DE.UTF-8 LOCALE: de_DE.UTF-8

xarray: 0.10.4
pandas: 0.22.0
numpy: 1.14.3
scipy: 1.0.1
netCDF4: 1.3.1
h5netcdf: 0.5.1
h5py: 2.7.1
Nio: None
zarr: None
bottleneck: 1.2.1
cyordereddict: None
dask: None
distributed: None
matplotlib: 2.2.2
cartopy: None
seaborn: None
setuptools: 39.2.0
pip: 10.0.1
conda: None
pytest: None
IPython: 6.3.1
sphinx: None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions