title: Formatted output from numpy arrays
body: <p>I have two (numpy) arrays that I want to write to file. The first is a 1-d array with integers of length n, the second is a 2-d array with the dimensions nx3. The output should be formatted according to (I8,TR5,3E14.6) TR5 = insert 5 whitespaces. I could do it with a loop over all n elements, but that doesn't feel pythonic. I have tried with numpy.savetxt(). It works nice with just the 2-d array, but I can't get my head around how to include the integer and blanks. Any suggestions?</p>
  
  <pre><code>import numpy as np
  
  fout = "outfile.txt"
  
  coord = np.array([[0.0,0.0,0.0],[1.0,1.0,1.0],[2.0,2.0,2.0]],float)
  nodnr = np.array([[1,2,3]],int)
  
  np.savetxt(fout,coord,delimiter=" ",fmt="%14.6E")
  </code></pre>
  
  <p>The output should look like this:</p>
  
  <pre><code>       1      0.000000E+00   0.000000E+00   0.000000E+00
         2      1.000000E+00   1.000000E+00   1.000000E+00
         3      2.000000E+00   2.000000E+00   2.000000E+00
  </code></pre>