savetxt(fname, X, fmt='%.18e', delimiter=' ', newline='\n', header='', footer='', comments='# ', encoding=None)
Further explanation of the :None:None:`fmt`
parameter ( %[flag]width[.precision]specifier
):
If the filename ends in .gz
, the file is automatically saved in compressed gzip format. loadtxt
understands gzipped files transparently.
Data to be saved to a text file.
A single format (%10.5f), a sequence of formats, or a multi-format string, e.g. 'Iteration %d -- %10.5f', in which case :None:None:`delimiter`
is ignored. For complex X
, the legal options for :None:None:`fmt`
are:
a single specifier, :None:None:`fmt='%.4e'`
, resulting in numbers formatted like :None:None:`' (%s+%sj)' % (fmt, fmt)`
a full string specifying every real and imaginary part, e.g. :None:None:`' %.4e %+.4ej %.4e %+.4ej %.4e %+.4ej'`
for 3 columns
a list of specifiers, one per column - in this case, the real and imaginary part must have separate specifiers, e.g. :None:None:`['%.3e + %.3ej', '(%.15e%+.15ej)']`
for 2 columns
String or character separating columns.
String or character separating lines.
String that will be written at the beginning of the file.
String that will be written at the end of the file.
String that will be prepended to the header
and footer
strings, to mark them as comments. Default: '# ', as expected by e.g. numpy.loadtxt
.
Encoding used to encode the outputfile. Does not apply to output streams. If the encoding is something other than 'bytes' or 'latin1' you will not be able to load the file in NumPy versions < 1.14. Default is 'latin1'.
Save an array to a text file.
save
Save an array to a binary file in NumPy .npy
format
savez
Save several arrays into an uncompressed .npz
archive
savez_compressed
Save several arrays into a compressed .npz
archive
>>> x = y = z = np.arange(0.0,5.0,1.0)See :
... np.savetxt('test.out', x, delimiter=',') # X is an array
... np.savetxt('test.out', (x,y,z)) # x,y,z equal sized 1D arrays
... np.savetxt('test.out', x, fmt='%1.4e') # use exponential notation
The following pages refer to to this document either explicitly or contain code examples using this.
numpy.savez
numpy.save
numpy.savez_compressed
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them