-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netcdf char array not being decoded to string in compound dtype #1977
Comments
We currently don't have any special code for handling of compound data types in xarray, but I'm open to adding that if necessary. Note that you currently cannot write compound dtypes to netCDF files. I think netCDF4-python is doing something sub-optimal here, but I'll comment in the other issue tracker. |
Now that Unidata/netcdf4-python#778 has been merged, it should be a bit easier to support this in xarray too. Though as previously mentioned, it will require no longer calling |
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the |
For the sake of completeness, this is still and issue in xarray 2024.10.0 but characters are returned concatenated using |
Code Sample, a copy-pastable example if possible
Problem description
When opening the attached dataset ,the char arrays in the compound dtype are not being converted into strings, despite
concat_characters=True
.bolo_geom_fromscript.nc.zip
Expected Output
The char arrays should be converted into strings (or at the very least, bytes if an encoding is not present):
Output of
xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.4.final.0
python-bits: 64
OS: Linux
OS-release: 4.13.0-32-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
xarray: 0.10.0
pandas: 0.22.0
numpy: 1.13.3
scipy: 1.0.0
netCDF4: 1.3.1
h5netcdf: None
Nio: None
bottleneck: 1.2.1
cyordereddict: None
dask: 0.15.3
matplotlib: 2.1.0
cartopy: None
seaborn: 0.8.0
setuptools: 38.5.1
pip: 9.0.1
conda: 4.4.11
pytest: 3.2.1
IPython: 6.2.1
sphinx: 1.6.3
The text was updated successfully, but these errors were encountered: