Read .mat files in Python

Gilad Naor picture Gilad Naor · May 17, 2009 · Viewed 395.7k times · Source

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.

Answer

Gilad Naor picture Gilad Naor · May 17, 2009

An import is required, import scipy.io...

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