Load in data to Python from .mat that contains multiple structs for each id?

Viewed 26

I have a large dataset in Matlab that I want to convert into a data frame in Python. The dataset is a 1*17 struct (one for each participant in an experiment). Each participant also has a struct with many variables that I am keen to analyze. So I am looking for a solution that helps me do this.

For Python, I found this documentation quite useful: https://docs.scipy.org/doc/scipy/reference/generated/scipy.io.loadmat.html

Using this information I have loaded the .mat file into python with the following code:

from scipy.io import loadmat

matlabData = loadmat(r"\LPS_IMU_Struct060621_Done.mat")
data = matlabData['LPS_Struct']
data.dtype

# Which return this information:
# dtype([('Name', 'O'), ('Table', 'O'), ('Array', 'O'), ('Time', 'O'), ('IMU_Number', 'O'), ('Cutted_Array', 'O'), ('ArrayRotated', 'O'), ('RunIndex', 'O'), ('Run_New_Index', 'O'), ('ArrayRotatedMoved', 'O'), ('IMU_Table', 'O')])

But I don't understand what I should do next. A helpful resource I found was this youtube video. But it doesn't seem to work in my case because I a many structs for each person. Is there a way to solve this problem?

0 Answers
Related