title: Convert integer to big endian binary file in python
body: <p>I'm trying to convert a 2D-array composed by integers to a big endian binary file using Python by this way:</p>
  
  <pre><code>import struct;
  
  fh=open('file.bin','wb')
  for i in range(width):
      for j in range(height):
          fh.write(struct.pack('&gt;i2',data[i,j]))
  
  fh.close()
  </code></pre>
  
  <p>when I open it with numpy:</p>
  
  <pre><code>a=np.fromfile('file.bin',dtype='&gt;i2')
  </code></pre>
  
  <p>The result is an array with zeros between original data:</p>
  
  <pre><code>[266,   0, 267,   0, 268,
     0, 272,   0, 268,   0, 264,   0, 266,   0, 264,   0, 263,   0,
   263,   0, 267,   0, 263,   0, 265,   0, 266,   0, 266,   0, 267,
     0, 267,   0, 266,   0, 265,   0, 270,   0, 270,   0, 270,   0,
   272,   0, 273,   0, 275,   0, 274,   0, 275]
  </code></pre>
  
  <p>That's what I'm trying to obtain: </p>
  
  <pre><code>[266,   267,  268,  272,  268,   264,  266,  264,  263, 
   263,   267,  263,  265,  266,   266,  267,
   267,   266,  265,  270,  270,   270,  272,  273,  275,  274,  275]
  </code></pre>
  
  <p>Do you know what is wrong with my code?</p>