Replies: 3 comments 3 replies
-
@GrgMdmn Please have a look at this issue: #7186 This comment by @tovogt shows a possible workaround: #7186 (comment) which might solve your problem. |
Beta Was this translation helpful? Give feedback.
-
Hello ! I would like your help, in order to solve my problem... I have not found any answer to my problem :( |
Beta Was this translation helpful? Give feedback.
-
I found a workaround : just remove the concerned variable and rewrite it with netcdf4 library, using the "fill_value" argument when creating the variable.
Did not find any solution based on xarray. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there ! I am trying to re-encode
b' '
byte as an attribute value for some of my variables. The problem is that xarray does not seem to appreciate this, whereas the nc files I am opening are encoding this way (so that provesb' '
bytes are netcdf4 compatible).Here is the easied way to reproduce the error, from a file that already has a variable attribute value which is a
b' '
byte.Here is a nc file example here (inside the zip), with a problem at the
DC_REFERENCE
key,_FillValue
attribute : GL_TS_DB_21528.zipI have tried using the encoding field, by entering this argument :
encoding = {'DC_REFERENCE': {'_FillValue' : np.bytes_(' ')}}
Another attempt to :
encoding = {'DC_REFERENCE': {'_FillValue': {'dtype': 'S1', 'data': b' '} }
For each trial, I then used this command, adding the
encoding
argument :xr.open_dataset(nc_path, engine='netcdf4', decode_times=False, decode_cf=False).to_netcdf(wd + '\\output_file.nc')
But I still encounter the same error. Do you know how to proceed ?
Beta Was this translation helpful? Give feedback.
All reactions