(
G,
nodelist=None,
dtype=None,
order=None,
multigraph_weight=sum,
weight="weight",
nonedge=0.0,
)
| 183 | |
| 184 | |
| 185 | def to_numpy_matrix( |
| 186 | G, |
| 187 | nodelist=None, |
| 188 | dtype=None, |
| 189 | order=None, |
| 190 | multigraph_weight=sum, |
| 191 | weight="weight", |
| 192 | nonedge=0.0, |
| 193 | ): |
| 194 | import numpy as np |
| 195 | |
| 196 | A = to_numpy_array( |
| 197 | G, |
| 198 | nodelist=nodelist, |
| 199 | dtype=dtype, |
| 200 | order=order, |
| 201 | multigraph_weight=multigraph_weight, |
| 202 | weight=weight, |
| 203 | nonedge=nonedge, |
| 204 | ) |
| 205 | M = np.asmatrix(A, dtype=dtype) |
| 206 | return M |
| 207 | |
| 208 | |
| 209 | def to_scipy_sparse_matrix(G, nodelist=None, dtype=None, weight="weight", format="csr"): |
nothing calls this directly
no test coverage detected