hdf5storage

how to import .mat-v7.3 file using h5py

梦想与她 提交于 2019-12-20 04:51:17
问题 I have .mat file which have 3 matrixes A, B, C. Actually I used scipy.io to import this mat file as below. data = sio.loadmat('/data.mat') A = data['A'] B = data['B'] C = data['C'] But, v7.3 file cannot import using this way. So, I tried to import using h5py but I don't know how to use h5py. My code is as below. f = h5py.File('/data.mat', 'r') A = f.get('/A') A = np.array('A') Which part is wrong? Thank you! 回答1: In Octave >> A = [1,2,3;4,5,6]; >> B = [1,2,3,4]; >> save -hdf5 abc.h5 A B In

how to import .mat-v7.3 file using h5py

有些话、适合烂在心里 提交于 2019-12-20 04:51:09
问题 I have .mat file which have 3 matrixes A, B, C. Actually I used scipy.io to import this mat file as below. data = sio.loadmat('/data.mat') A = data['A'] B = data['B'] C = data['C'] But, v7.3 file cannot import using this way. So, I tried to import using h5py but I don't know how to use h5py. My code is as below. f = h5py.File('/data.mat', 'r') A = f.get('/A') A = np.array('A') Which part is wrong? Thank you! 回答1: In Octave >> A = [1,2,3;4,5,6]; >> B = [1,2,3,4]; >> save -hdf5 abc.h5 A B In

how to import .mat-v7.3 file using h5py

大憨熊 提交于 2019-12-02 07:08:19
I have .mat file which have 3 matrixes A, B, C. Actually I used scipy.io to import this mat file as below. data = sio.loadmat('/data.mat') A = data['A'] B = data['B'] C = data['C'] But, v7.3 file cannot import using this way. So, I tried to import using h5py but I don't know how to use h5py. My code is as below. f = h5py.File('/data.mat', 'r') A = f.get('/A') A = np.array('A') Which part is wrong? Thank you! In Octave >> A = [1,2,3;4,5,6]; >> B = [1,2,3,4]; >> save -hdf5 abc.h5 A B In Ipython In [138]: import h5py In [139]: f = h5py.File('abc.h5') In [140]: list(f.keys()) Out[140]: ['A', 'B']