I am trying to import a MATLAB (.mat -7.3) file in Python 3.8 using the h5py module. The file contains a structure class and table class. I successfully imported the structure class object. However, the table class is showing wrong dimensions after importing.
import h5py
Path='data/LUT_0/LUT_0.mat' #path file path to be read
f = h5py.File(Path, mode='r') #read mat file
list(f.keys())
Results in:
['#refs#', '#subsystem#', 'LUT_Refl', 'LUT_Var']
LUT_Var is a <HDF5 dataset "LUT_Var": shape(1,6), type"">. Trying to access the data results in:
f['LUT_Var'][()]
array([[3707764736, 2, 1, 1, 1,
1]], dtype=uint32)
However, I am expecting a table of the size: 169560x12. When I export this table as a txt file from MATLAB, I can import is just fine in Python. I can also re-import the .mat file in MATLAB and don´t see any corruption of the data. Does anyone know what could be missing here?
Thanks.