title: Reading large binary files (>2GB) with python
body: <p>I am writing a program to process some binary files.
  I used to use <code>numpy.fromfile</code> and everything worked fine until I came across some big binary file (>2gb) since numpy can't read them (memory problems) after trying unsuccesfully with h5py since I didn't get how to convert my files to h5 files. I was trying to use <code>open()</code>, <code>read()</code> and <code>struct.unpack_from</code>, in order to reconstruct the data as I would have done in c++.</p>
  
  <p>My binary files represent 32 bit floats that are to be paired into 64bit complex.</p>
  
  <p>The problem at the moment is that even if from the info I gathered <code>struct.unpack_from()</code> should return a tuple with all the datas of the specified type in the file it only returns the first element of the file:</p>
  
  <p>The code:</p>
  
  <pre><code>f1 = open(IQ_File, 'rb')
  a1 = f1.read()       
  f = struct.unpack_from('f', a1)
  print(f)
  </code></pre>
  
  <p>What I am expecting here is an output with the binary back to floats, however my output is only:</p>
  
  <pre><code>(-0.057812511920928955,)
  </code></pre>
  
  <p>-- a tuple containing only the first float of the file.</p>
  
  <p>I really don't understand what I am doing wrong here.
  What should I be doing differently?</p>