How to load and convert .mat file into numpy 2D array?

Abdullah Danyal picture Abdullah Danyal · May 13, 2017 · Viewed 10.1k times · Source

I have a data in mat file (observations and features) and i want to load it into numpy 2D array. I dont want to convert it into csv first and then load csv into numpy.

Answer

sascha picture sascha · May 13, 2017

Use scipy's loadmat (API-docs).

The docs should be sufficient to get you going, but make sure to read the notes.

There is also the io-tutorial with some examples.