SciPy

This is documentation for an old release of SciPy (version 0.18.1). Read this page in the documentation of the latest stable release (version 1.15.1).

scipy.sparse.csgraph.csgraph_from_masked

scipy.sparse.csgraph.csgraph_from_masked(graph)

Construct a CSR-format graph from a masked array.

New in version 0.11.0.

Parameters:

graph : MaskedArray

Input graph. Shape should be (n_nodes, n_nodes).

Returns:

csgraph : csr_matrix

Compressed sparse representation of graph,