python 2.7.13 / h5py 2.9.0
Я пытаюсь увидеть атрибут в файле HDF5 с h5py.
Ошибки возникают, когда я использую foo.attrs.values () или foo.attrs ['attribute_keys']
IOError: невозможно прочитать атрибут (нет подходящей функции для пути преобразования)
Я могу получить доступ к ключам с помощью attrs.keys ()
но attrs.values (), attrs.items () не работали.
#working in shell
>>> f=h5py.File('D:\read\sample.h5','r')
>>> f.attrs.keys()
[u'_NCProperties', u'satellite_name', u'instrument_name', u'data_processing_center', u'data_processing_mode', u'channel_spatial_resolution'... so on]
>>> f.attrs.values()
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
f.attrs.values()
File "C:\Python27\lib\site-packages\h5py\_hl\base.py", line 374, in values
return [self.get(x) for x in self]
File "C:\Python27\lib\_abcoll.py", line 382, in get
return self[key]
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "C:\Python27\lib\site-packages\h5py\_hl\attrs.py", line 81, in __getitem__
attr.read(arr, mtype=htype)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5a.pyx", line 355, in h5py.h5a.AttrID.read
File "h5py\_proxy.pyx", line 36, in h5py._proxy.attr_rw
IOError: Unable to read attribute (no appropriate function for conversion path)
>>> f.attrs['file_name']
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
f.attrs['file_name']
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "C:\Python27\lib\site-packages\h5py\_hl\attrs.py", line 81, in __getitem__
attr.read(arr, mtype=htype)
File "h5py\_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py\_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py\h5a.pyx", line 355, in h5py.h5a.AttrID.read
File "h5py\_proxy.pyx", line 36, in h5py._proxy.attr_rw
IOError: Unable to read attribute (no appropriate function for conversion path)