title: Quickly read HDF 5 file in python?
body: <p>I have an instrument that saves data (many traces from an analog-to-digital converter) as an HDF 5 file. How can I efficiently open this file in python? I have tried the following code, but it seems to take a very long time to extract the data. </p>
  
  <p>Also, it reads the data in the wrong order: instead of reading 1,2,3, it reads 1,10,100,1000. </p>
  
  <p>Any ideas? </p>
  
  <p>Here is a link to the sample data file: <a href="https://drive.google.com/file/d/0B4bj1tX3AZxYVGJpZnk2cDNhMzg/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B4bj1tX3AZxYVGJpZnk2cDNhMzg/edit?usp=sharing</a></p>
  
  <p>And here is my super-slow code:</p>
  
  <pre><code>import h5py
  import matplotlib.pyplot as plt
  import numpy as np
  
  
  f = h5py.File('sample.h5','r')
  
  ks = f.keys()
  
  for index,key in enumerate(ks[:10]):
      print index, key
      data = np.array(f[key].values())
      plt.plot(data.ravel())
  
  plt.show()
  </code></pre>