5

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.

1
  • stackoverflow.com/questions/43875194/… illustrates loading a simple MATLAB matrix. If you have cells or structs the loaded dictionary is more complicated. Commented May 13, 2017 at 15:12

1 Answer 1

6

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.

Sign up to request clarification or add additional context in comments.

1 Comment

So useful. The loadmat() returns a dict type and we can get the array by its key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.