scipy.io.mmwrite

scipy.io.mmwrite(target, a, comment='', field=None, precision=None, symmetry=None)[source]

Writes the sparse or dense array a to Matrix Market file-like target.

Parameters
targetstr or file-like

Matrix Market filename (extension .mtx) or open file-like object.

aarray like

Sparse or dense 2-D array.

commentstr, optional

Comments to be prepended to the Matrix Market file.

fieldNone or str, optional

Either ‘real’, ‘complex’, ‘pattern’, or ‘integer’.

precisionNone or int, optional

Number of digits to display for real or complex values.

symmetryNone or str, optional

Either ‘general’, ‘symmetric’, ‘skew-symmetric’, or ‘hermitian’. If symmetry is None the symmetry type of ‘a’ is determined by its values.