is something like this ready-made in matplotlib,
> corresponding to the load() function?:
> save('output.csv', data, fmt='%1.4e', delimiter=';')
pylab.save has this. In the latest release there is no delimiter
field (it assumes space delimited) but in CVS there is a version with
a delimiter
In [2]: import pylab
In [3]: pylab.save?
Type: function
Base Class: <type 'function'>
String Form: <function save at 0xb5e5e72c>
Namespace: Interactive
File: /usr/lib/python2.4/site-packages/matplotlib/pylab.py
Definition: pylab.save(fname, X, fmt='%.18e', delimiter=' ')
Docstring:
Save the data in X to file fname using fmt string to convert the
data to strings
fname can be a filename or a file handle. If the filename ends in
.gz,
the file is automatically saved in compressed gzip format. The
load()
command understands gzipped files transparently.
Example usage:
save('test.out', X) # X is an array
save('test1.out', (x,y,z)) # x,y,z equal sized 1D arrays
save('test2.out', x) # x is 1D
save('test3.out', x, fmt='%1.4e') # use exponential notation
delimiter is used to separate the fields, eg delimiter ',' for
comma-separated values