Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #104534
| Newsgroups | comp.lang.python |
|---|---|
| Date | 2016-03-10 08:50 -0800 |
| Message-ID | <f8787852-6566-4ed5-a969-262372be243e@googlegroups.com> (permalink) |
| Subject | HDF5 data set, unable to read contents |
| From | varun7rs@gmail.com |
Hello everyone,
I recently came across a package called matrix2latex which simplifies the creation of very large tables. So, I saved my data in .mat format using the '-v7.3' extension so that they can be read by python.
Now, when I try to read these files, I'm having some problems in reproducing the whole matrix. Whenever I try and print out an element of the array, I only get 'HDF5 object reference' as the output. This is basically the short code I wrote and what I basically want to do is have the values of the elements in the arrays and not the 'HDF5 object reference' thing. ex [ [ 1 2 3 4 ], [2 3 4 5 ]...]
Could you please help me with this? The link to the .mat file is as below
https://drive.google.com/file/d/0B2-j91i19ey2Nm1CbVpCQVdZc3M/view?usp=sharing
import numpy as np, h5py
from matrix2latex import matrix2latex
f = h5py.File('nominal_case_unfix.mat', 'r')
data = f.get('nominal_case_unfix')
np_data = np.array(data)
print np_data
Thank You
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
HDF5 data set, unable to read contents varun7rs@gmail.com - 2016-03-10 08:50 -0800 Re: HDF5 data set, unable to read contents dieter <dieter@handshake.de> - 2016-03-11 10:37 +0100 Re: HDF5 data set, unable to read contents Peter Otten <__peter__@web.de> - 2016-03-11 12:12 +0100
csiph-web