issue with numpy.savetxt - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: issue with numpy.savetxt (/thread-11513.html) |
issue with numpy.savetxt - alyssaantarctica - Jul-12-2018 I'm trying to save the following in a txt file: relmax = [ 6.9251146 7.23467703 10.5914501 ] relmin = [ 7.10074018 8.9889703 12.6603858 ]However, the file saves with the 10.59 etc as 1.059 and the 12.660 etc as 1.2660. What's happening? The code I'm using for savetxt is np.savetxt('sat 10 relative extrema', np.transpose([relmax, relmin]), delimiter=' ', header = 'time of apicenters, time of pericenters')Thanks RE: issue with numpy.savetxt - Larz60+ - Jul-13-2018 I think (I am by no means an expert at this) that you need to use a fmt string to specify the value format:
|