15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.6.2 Matrix Market files<br />

SciPy Reference Guide, Release 0.8.dev<br />

mminfo(source) Queries the contents of the Matrix Market file ‘filename’ to<br />

mmread(source) Reads the contents of a Matrix Market file ‘filename’ into a<br />

mmwrite(target, a[, comment, field,<br />

precision])<br />

matrix.<br />

Writes the sparse or dense matrix A to a Matrix Market formatted<br />

file.<br />

mminfo(source)<br />

Queries the contents of the Matrix Market file ‘filename’ to extract size and storage information.<br />

Inputs:<br />

Outputs:<br />

source - Matrix Market filename (extension .mtx) or open file object<br />

rows,cols - number of matrix rows and columns entries - number of non-zero entries of a sparse<br />

matrix<br />

or rows*cols for a dense matrix<br />

format - ‘coordinate’ | ‘array’ field - ‘real’ | ‘complex’ | ‘pattern’ | ‘integer’ symm - ‘general’ |<br />

‘symmetric’ | ‘skew-symmetric’ | ‘hermitian’<br />

mmread(source)<br />

Reads the contents of a Matrix Market file ‘filename’ into a matrix.<br />

Inputs:<br />

Outputs:<br />

source - Matrix Market filename (extensions .mtx, .mtz.gz)<br />

or open file object.<br />

a - sparse or full matrix<br />

mmwrite(target, a, comment=”, field=None, precision=None)<br />

Writes the sparse or dense matrix A to a Matrix Market formatted file.<br />

Inputs:<br />

3.6.3 Other<br />

target - Matrix Market filename (extension .mtx) or open file object a - sparse or full matrix comment<br />

- comments to be prepended to the Matrix Market file field - ‘real’ | ‘complex’ | ‘pattern’ |<br />

‘integer’ precision - Number of digits to display for real or complex values.<br />

save_as_module([file_name, data]) Save the dictionary “data” into<br />

npfile(*args, **kwds) npfile is deprecated!<br />

save_as_module(file_name=None, data=None)<br />

Save the dictionary “data” into a module and shelf named save<br />

npfile(*args, **kwds)<br />

npfile is deprecated!<br />

You can achieve the same effect as using npfile using numpy.save and numpy.load.<br />

You can use memory-mapped arrays and data-types to map out a file format for direct manipulation in NumPy.<br />

Class for reading and writing numpy arrays to/from files<br />

3.6. Input and output (<strong>scipy</strong>.io) 213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!