question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

scipy.io.loadmat for Matlab 7.3

See original GitHub issue

Is your feature request related to a problem? Please describe. Currently, scipy is unable to load MATLAB files that are saved with the new MATLAB file format. Attempting to load them will raise an

NotImplementedError: Please use HDF reader for matlab v7.3 files

Describe the solution you’d like

I’ve implemented a small library that can also load MATLAB 7.3 https://github.com/skjerns/mat7.3 , using h5py. It will load all data with the indicated MATLAB datatype into a dict, so similar to scipy.io.loadmat.

Do you think it makes sense to integrate this directly into scipy?

Describe alternatives you’ve considered

Just leaving it as it is might be actually okay, as adding it would introduce a dependency on h5py (which is not a dependency of scipy afaik?). what do you think?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:4
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
matthew-brettcommented, Jan 12, 2020

I don’t think we should add the h5py dependency unconditionally, but it could work as an optional dependency, so it gives an error message when h5py is not installed, suggesting the user install it.

The output should be consistent with the current output for other .mat files, unless there’s a good reason for that not to be true.

0reactions
pvcommented, Jan 13, 2020

Retaining backward compatibility is a constraint in additions, though. Adding new loading options, and changing behavior in previously undefined cases is generally easy, otherwise painful as how to do the transition needs to be planned and justified.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reading v 7.3 mat file in python
The files can be opened, sure, but with scipy.io.loadmat the file is represented in transparent data structures (namely, dictionaries and numpy arrays). The ......
Read more >
scipy.io.loadmat — SciPy v1.9.3 Manual
Returns matrices as would be loaded by MATLAB (implies squeeze_me=False, chars_as_strings=False, mat_dtype=True, struct_as_record=True). struct_as_recordbool, ...
Read more >
mat73
Load MATLAB .mat 7.3 into Python native data types (via h5/hd5/hdf5/h5py) ... This means they cannot be loaded by scipy.io.loadmat any longer and...
Read more >
unable to load mat file which was saved in python as ...
I have a mat file which was created in python using savemat at version 7.3. The data is perfectly loading in matlab version...
Read more >
scipy.io.loadmat — SciPy v0.8.dev Reference Guide (DRAFT)
scipy.io.loadmat¶ ... v4 (Level 1.0), v6 and v7 to 7.2 matfiles are supported. You will need an HDF5 python library to read matlab...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found