nigsp.io.load_mat

nigsp.io.load_mat(fname, shape=None)[source]

Read files in matlab format.

Assumes the existence of a matrix/vector in the mat file, rendered as a numpy.ndarray. If there is more than a matrix, the one with the largest size will be selected.

Parameters:
fnamestr or os.PathLike

Path to the mat file

shapeNone, ‘square’, or ‘rectangle’}, str, optional

Shape of matrix, if empty, skip check

Returns:
mtxnumpy.ndarray

Data matrix

Raises:
EOFError

If the mat file does not contain matrix or vectors.

ImportError

If pymatreader is not installed or can’t be read.

See also

check_mtx_dim

Notes

Requires module pymatreader to work