Problems with newline parameter in numpy savetxt function
<p>Having the structured array like this :</p>

<p><code>[ (b'H', 0.9425, 0.1412, 7.1414) ... (b'N', 1.0037, 4.0524, 6.8000)]</code></p>

<p>I want to make a <code>.txt file</code> using <code>numpy.savetxt</code> where each element of the array is written in separate line:</p>

<pre><code>H   0.9425   0.1412   7.1414
N   1.0037   4.0524   6.8000
</code></pre>

<p>I set the <code>newline='\n'</code> but it doesn't work properly and all the elements are written in single line. The same problem with <strong><em>header</em></strong> parameter, the specified header is also printed in the same line.</p>

<p>Now it looks like this:</p>

<pre><code>29Shifts: 1.0  3.0  7.0b'C' 1.0029  3.5098  7.9883 b'N' 1.0039  4.0586  6.8008 
29Shifts: 1.0  4.0  0.0b'C' 1.0029  4.5078  0.9873 b'N' 1.0039  5.0586  -0.2000
29Shifts: 1.0  5.0  9.0b'C' 1.0029  5.5078  9.9844 b'N' 1.0039  6.0586  8.7969 
</code></pre>

<p>Here are the parameters used:</p>

<pre><code>np.savetxt(outfile, recarray, fmt=[b'%s','%-7.4f','%-7.4f','%-7.4f'], delimiter='  ', newline='\n', header='29\nShifts: 1.0 1.0 3.5\n', comments='')
</code></pre>

<p>Thank you</p>