mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2025-01-09 05:34:27 +00:00
correct decoding of byte arrays
This commit is contained in:
parent
e78c170a2b
commit
5e154ce21e
1 changed files with 4 additions and 1 deletions
|
@ -131,9 +131,12 @@ class H5Proxy:
|
|||
item = (item, self.field)
|
||||
|
||||
try:
|
||||
# single string
|
||||
return obj[item].decode(encoding.encoding)
|
||||
except AttributeError:
|
||||
return np.strings.decode(obj[item], encoding=encoding.encoding)
|
||||
# numpy array of bytes
|
||||
return np.char.decode(obj[item], encoding=encoding.encoding)
|
||||
|
||||
else:
|
||||
obj = obj.fields(self.field)
|
||||
else:
|
||||
|
|
Loading…
Reference in a new issue