SciPy 0.6.0 API Documentation Generated by Endo, 2007-10-17
This module allows for the loading of an array from an ASCII Text File
default = None
Ascii_stream instances can be used like normal read-only file objects (i.e
Return an array or arrays from ascii_formatted data in |fileobject|.
Inputs:
fileobject -- An open file object or a string for a valid filename.
The string can be prepended by "~/" or "~<name>/" to
read a file from the home directory.
separator -- a string or a tuple of strings to indicate the column
separators. If the length of the string tuple is less
than the total number of columns, then the last separator
is assumed to be the separator for the rest of the columns.
columns -- a tuple of integers and range-tuples which describe the
columns to read from the file. A negative entry in the
last column specifies the negative skip value to the end.
Example: columns=(1, 4, (5, 9), (11, 15, 3), 17, -2)
will read [1,4,5,6,7,8,11,14,17,19,21,23,...]
If multiple arrays are to be returned, then this argument
should be an ordered list of such tuples. There should be
one entry in the list for each arraytype in the atype list.
lines -- a tuple with the same structure as columns which indicates
the lines to read.
comment -- the comment character (line will be ignored even if it is
specified by the lines tuple)
linesep -- separator between rows.
missing -- value to insert in array when conversion to number fails.
atype -- the typecode of the output array. If multiple outputs are
desired, then this should be a list of typecodes. The columns
to fill the array represented by the given typecode is
determined from the columns argument. If the length of atype
does not match the length of the columns list, then, the
smallest one is expanded to match the largest by repeatedly
copying the last entry.
rowsize -- the allocation row size (array grows by this amount as
data is read in).
Output -- the 1 or 2d array, or a tuple of output arrays of different
types, sorted in order of the first column to be placed
in the output array.
Write a rank-2 or less array to file represented by fileobject. Inputs: fileobject -- An open file object or a string to a valid filename. arr -- The array to write. separator -- separator to write between elements of the array. linesep -- separator to write between rows of array precision -- number of digits after the decimal place to write. suppress_small -- non-zero to round small numbers down to 0.0 keep_open = non-zero to return the open file, otherwise, the file is closed. Outputs: file -- The open file (if keep_open is non-zero)
| Local name | Refers to |
|---|---|
| array | numpy.array |
| asarray | numpy.asarray |
| concatenate | numpy.concatenate |
| Float | numpy.oldnumeric.Float |
| imag | numpy.imag |
| numpy | numpy |
| numpyio | SciPy.io.numpyio |
| os | os |
| re | re |
| real | numpy.real |
| sys | sys |
| take | numpy.take |
| types | types |