Read .mat files in Python

后端 未结 8 1732
时光说笑
时光说笑 2020-11-22 09:23

Is it possible to read binary MATLAB .mat files in Python?

I\'ve seen that SciPy has alleged support for reading .mat files, but I\'m unsuccessful with it. I install

8条回答
  •  余生分开走
    2020-11-22 09:48

    First save the .mat file as:

    save('test.mat', '-v7')
    

    After that, in Python, use the usual loadmat function:

    import scipy.io as sio
    test = sio.loadmat('test.mat')
    

提交回复
热议问题