Python nested lists imported from matlab

I am importing a large structure from Matlab to Python using scipy.io. The data seems to be imported in OK, but it is filled with nested lists which I cannot simplify. Here's one of the simplest examples:

sc = sio.loadmat(matlabFile)
sc['DieID']['w']

      

which leads to the following result:

array([[array([[ 1309.09090909]]), array([[ 1309.09090909]]),
    array([[1000]], dtype=uint16)]], dtype=object)

      

Could you please suggest how can I reduce this particular field to a simple list [1309.09090909, 1309.09090909, 1000]?

Thanks for your help!

+3


source to share





All Articles