<html dir="ltr"><head></head><body style="text-align:left; direction:ltr;"><div>Le mardi 08 octobre 2019, Stephen P. Molnar a écrit :</div><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>data = np.genfromtxt("13-7.log", usecols=(1), dtype=None, </pre><pre>skip_header=27, skip_footer=1, encoding=None)</pre><pre>print(data)</pre><pre>[...]</pre></blockquote><pre><br></pre><blockquote type="cite" style="margin:0 0 0 .8ex; border-left:2px #729fcf solid;padding-left:1ex"><pre>['-8.839713733' '-8.743377250' '-8.151051167' '-8.090452911'</pre><pre>  '-7.967494477' '-7.854890056' '-7.757417879' '-7.741557490'</pre><pre>  '-7.643885488' '-7.611595767' '-7.507605524' '-7.413920814'</pre><pre>  '-7.389408331' '-7.384446364' '-7.374206276' '-7.368808179'</pre><pre>  '-7.346641418' '-7.325037898' '-7.309614787' '-7.113209147']</pre></blockquote></blockquote><div><br></div><div>Hi,</div><div>Note that your <b>data</b> array is made of strings and not floats.</div><div>The default value of the <b>dtype</b> argument is <b>float</b>, which you override by <b>None.</b></div><div>Remove the 'dtype=None' part to correctly load data</div><div><br></div><div>You then have no problem to save your data with the format you want.</div><div><br></div><div>Fabrice</div><div><br></div><div>PS : be aware that [data] is a 2D row array, that will end up inlined with command</div><div><span style="caret-color: rgb(32, 74, 135); color: rgb(32, 74, 135); font-family: "Fira Mono";">np.savetxt('13-7', [data], fmt='%15.9f', header='13-7')</span></div><div><div>Remove the bracket for a one-per-line formatted output</div><div><span style="caret-color: rgb(32, 74, 135); color: rgb(32, 74, 135); font-family: "Fira Mono";">np.savetxt('13-7', data, fmt='%15.9f', header='13-7')</span></div></div></body></html>