I have MATLAB data files which contain multiple structs within struct that i want to import into python. In MATLAB, if main_struct
is the main file, I can get down to the data I need by -
leaf1 = main_struct.tree1.leaf1
leaf2 = main_struct.tree1.leaf2
and so on. Now I want to import the .mat file containing struct in python and access leaf1
and leaf2
. In python, I can load the mat files -
import scipy.io as sio
data = sio.loadmat("main_struct.mat",squeeze_me=True, struct_as_record=False);
tree1 = data.['tree1'];
How do I access the second struct in tree1
?