| |
- awrite(data, outFile=None, format='%g ', comments=None, append=False, commentChar='#')
- Write (a) numeric array(s) to file (or fileObject, or stdout if unspecified).
data: a numpy array or a list/tuple of numpy arrays (with consistent number of rows, i.e., identical first shape)
outFile: filename or file object
if unspecified: write to stdout
if an already opened file object, awrite does not close the file after writing
format: must have one, two, or data.shape[1] specifiers (line feed is appended if necessary)
comments: a (list of) string(s) to be written as a file header in front of the data
append: flag
commentChar: default #
[awrite is similar to numpy.savetxt, but smarter, more flexible, ....
Note that the output file (object) is optional here, hence the second argument!]
- cstack(*arrays)
- Shorthand robust version of numpy.column_stack: 'paste' arrays side-by-side.
See also the numpy builtin c_
- grep_from_header(inFile, keyword, sep=':', commentChar='#')
- Scan thru list of records (typically read as file header), search for ONE keyword, and return its 'value'.
(Equivalent to parse_comments (readFileHeader(file),keyword)[keyword], but returns only the entry).
- loadxy(xyFile, usecols=(0, 1), xLimits=None, verbose=False, commentChar='#')
- Read a tabular two-column ascii file with loadtxt and separately return the xGrid and the yValues arrays.
ARGUMENTS:
----------
xyFile: the data file
usecols: pair of ints indicating the columns to read (default (0,1))
xLimits: an Interval (pair of floats) for the abscissa bounds (default None)
verbose: flag (default False)
commentChar: default '#'
RETURNS:
--------
xGrid: an numpy array of abscissa grid points
yValues: an numpy array of data values (ordinate)
- loadxyy(xyyFile, xLimits=None, verbose=False, commentChar='#')
- Read a tabular ascii file with loadtxt and separately return the xGrid array and the yValues 'matrix'.
(See `loadxy' for the arguments.)
- minmaxmean(xy, name='xy')
- Print some 'statistics' of a numpy array.
|