This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / io / _mmio / MMFile / read

function

scipy.io._mmio:MMFile.read

source: build-install/usr/lib/python3.14/site-packages/scipy/io/_mmio.py:573

Signature

def read(self, source, *, spmatrix = <object object at 0x0000>)

Summary

Reads the contents of a Matrix Market file-like 'source' into a matrix.

Parameters

source : str or file-like

Matrix Market filename (extensions .mtx, .mtz.gz) or open file object.

spmatrix : bool, optional (default: True)

If True, return sparse matrix. Otherwise return sparse array.

.. deprecated:: 2.0.0

The value True for spmatrix will no longer be supported in v2.2. The spmatrix classes are deprecated and will be removed then.

Returns

a : ndarray or coo_array or coo_matrix

Dense or sparse array depending on the matrix format in the Matrix Market file.

Aliases

  • scipy.io._mmio.MMFile.read