title: Python - Reading HDF5 dataset into a list vs numpy array
body: <p>I've been exploring HDF5 and its python interface (h5py) so I tried to read a HDF5 file (one dimensional array of 100 million integers) into: a normal list and another time to a numpy array. Converting the dataset to a numpy was very fast comparing to when I tried to convert it to a normal python list (actually doing it with a list took a very long time that I had to kill it before it finished). </p>
  
  <p>Can any one help me understand what happens internally that makes  converting HDF5 dataset to a numpy array extremely faster than doing it with a normal list? Does it has to do with h5py compatibility with numpy?</p>
  
  <pre><code>import numpy as np
  import hdf5
  
  def readtolist(dataset):
      return "normal list count = {0}".format(len(list(dataset['1'])))
  
  def readtonp(dataset):
      n1 = np.array(dataset)
      return "numpy count = {0}".format(len(n1))
  
  f = h5py.File(path, 'r')    
  readtolist(f['1'])
  readtonp(f['1'])
  </code></pre>
  
  <p>Thanks for the help! </p>