I know this has been asked before but in my opinion there are still no answers that explain what is going on and don't happen to work for my case. I have a matlab v7.3 file that is structured like so,
---> rank <1x454 cell> ---> each element is <53x50 double>
f.mat
---> compare <1x454 cell> ---> each element is <53x50 double>
I hope this is straight forward enough. So what I am trying to do is read all 454 arrays with dimensions 53x54 from the cell array named 'rank', into a list of numpy arrays in python using the h5py library like so:
import h5py
with h5py.File("f.mat") as f:
data = [np.array(element) for element in f['rank']]
what I end up with is a list of arrays of HDF5 object references:
In [53]: data[0]
Out[53]: array([<HDF5 object reference>], dtype=object)
What do I do with this / how do I get the list of arrays that I need?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…