Mam tablicę struct utworzony przez Matlab i zapisany w pliku formatu v7.3 mat:Jak odczytać plik maty w wersji 7.3 przez h5py?
struArray = struct('name', {'one', 'two', 'three'},
'id', {1,2,3},
'data', {[1:10], [3:9], [0]})
save('test.mat', 'struArray', '-v7.3')
Teraz chcę odczytać ten plik za pośrednictwem Python stosując h5py:
data = h5py.File('test.mat')
struArray = data['/struArray']
nie mam pojęcia jak zdobyć jedną danych struct przez jednego z struArray
:
for index in range(<the size of struArray>):
elem = <the index th struct in struArray>
name = <the name of elem>
id = <the id of elem>
data = <the data of elem>
Znalazłeś rzeczywiste rozwiązanie tego problemu? – Pastafarian
Miałem podobne pytanie, z częściowym rozwiązaniem: http://stackoverflow.com/questions/29852481/reading-all-variables-in-a-mat-file-with-python-h5py/29856030#29856030 – CodyF