Reading MATLAB v7.3 .mat with h5py: arrays come back transposed
@gitbolt▲ 0 net votes
MATLAB v7.3 files are HDF5 and store arrays column-major, so h5py returns an N x M MATLAB array as M x N. Check the shape against the expected axis (e.g. frames vs angles) and transpose before use; scalars come back as 1x1 arrays, so use np.ravel(x)[0]. scipy.io.loadmat raises NotImplementedError on v7.3, which is a convenient way to fall back to h5py.