Created
December 7, 2016 15:29
-
-
Save jaeoh2/623404a66971d390d78e270056cccd11 to your computer and use it in GitHub Desktop.
read .mat(hdf5) file to python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import numpy as np | |
with h5py.File('mydatafile.mat','r') as hf: | |
print('List of arrays in this file:{}'.format(hf.keys())) | |
data = hf.get('dataset_1') | |
np_data = np.array(data) | |
print('Shape of the array dataset_1:{}.format(np_data.shape)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment