I have been able to write .mat-v7.3 files with hdf5storage after reading the answers to Create .mat v7.3 files from Python using hdf5storage but I'm convinced I can achieve the same result by setting the right headers while writing my .mat file.
Assume that I have a Pandas dataframe built from the following data:
[
{'time': 0, 'sig0': 0.6153857, 'sig1': 0.070254125, 'sig2': 0.025843188},
{'time': 586576558, 'sig0': 0.6015989, 'sig1': 0.7131938, 'sig2': 0.42542282},
...
{'time': 589999558, 'sig0': 0.1598977, 'sig1': 0.6131938, 'sig2': 0.88882282}
]
How can I parse this data and create a hdf5 file that is .mat-v7.3 compatible?
If you look at hdf5storage's GitHub repo, you will find the headers defined here, and it says you need a 512 bytes block of metadata containing things like datetime creation, platform version, character encoding and so on.
Then, all you need is to create dataset based on your dataframe columns. Here's an example combining these two steps:
That's it, I hope this Q&A helps people trying to export .mat compatible hdf5 files with Python.