title: Loading the binary data to a NumPy array
body: <p>I am having trouble reading the binary file. I have a NumPy array as,</p>
  <pre><code>data = array([[ 0.        ,  0.        ,  7.821725  ],
                [ 0.05050505,  0.        ,  7.6358337 ],
                [ 0.1010101 ,  0.        ,  7.453858  ],
                ...,
                [ 4.8989897 ,  5.        , 16.63227   ],
                [ 4.949495  ,  5.        , 16.88153   ],
                [ 5.        ,  5.        , 17.130795  ]], dtype=float32)
  </code></pre>
  <p>I wrote this array to a file in binary format.</p>
  <pre><code>file = open('model_binary', 'wb')
  data.tofile(file)
  </code></pre>
  <p>Now, I am unable to get back the data from the saved binary file. I tried using <code>numpy.fromfile()</code> but it didn't work out for me.</p>
  <pre><code>file = open('model_binary', 'rb')
  data = np.fromfile(file)
  </code></pre>
  <p>When I printed the data I got <code>[0.00000000e+00 2.19335211e-13 8.33400000e+04 ... 2.04800049e+03 2.04800050e+03 5.25260241e+07]</code> which is absolutely not what I want.</p>
  <p>I ran the following code to check what was in the file,</p>
  <pre><code>for line in file:
      print(line)
      break
  </code></pre>
  <p>I got the output as <code>b'\x00\x00\x00\x00\......\c1\x07@\x00\x00\x00\x00S\xc5{@j\xfd\n'</code> which I suppose is in binary format.</p>
  <p>I would like to get the array back from the binary file as it was saved. Any help will be appreciated.</p>