(Apologies if I’m using any terminology incorrectly—I’m pretty new to this)
I’m currently trying to load a .mat file in Python. I used the SciPy loadmat() method, as shown below.
from scipy.io import loadmat
data = loadmat('filename.mat')
The result is a dictionary with the correct variable names, but the values (aside from the header, version, and globals) are arrays of NaNs, as shown below.
array([[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]])
Any ideas what might be causing this, or how to get it to load the data properly?
I checked the MathWorks site, and found that there are MATLAB types that aren’t supported in Python, but I’m unsure as to whether that would cause this, or how to fix it if that is the cause.
Thanks.
Fin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.