savetxt
- mdtools.file_handler.savetxt(fname, data, rename=True, **kwargs)[source]
Save an array to a text file.
- Parameters:
fname (
str
oros.PathLike
) – The name of the file to create.data (
array_like
) – 1- or 2-dimensional array of data to be saved.rename (
bool
, optional) – IfTrue
and a file called fname already exists, rename it to'fname.bak_timestamp'
. Seemdtools.file_handler.backup()
for more details.kwargs (
dict
, optional) – Additional keyword arguments to parse tonumpy.savetxt()
. See there for possible arguments and their description. By default, fmt is set to'%16.9e'
.
See also
numpy.savetxt()
Save an array to a text file
mdtools.file_handler.savetxt_matrix()
Save a data matrix to a text file
mdtools.file_handler.header_str()
Create a standard header string for text files
mdtools.file_handler.backup()
Backup a file by renaming it
Notes
This function simply calls
numpy.savetxt()
and adds a MDTools specific header to the output file. Seemdtools.file_handler.header_str()
for further information about what is included in the header.