Fix Python – Read .mat files in Python

Question

Asked By – Gilad Naor

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 installed SciPy version 0.7.0, and I can’t find the loadmat() method.

Now we will see solution for issue: Read .mat files in Python


Answer

An import is required, import scipy.io

import scipy.io
mat = scipy.io.loadmat('file.mat')

This question is answered By – Gilad Naor

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0