MCPcopy Create free account
hub / github.com/alibaba/GraphScope / to_numpy_matrix

Function to_numpy_matrix

python/graphscope/nx/convert_matrix.py:185–206  ·  view source on GitHub ↗
(
    G,
    nodelist=None,
    dtype=None,
    order=None,
    multigraph_weight=sum,
    weight="weight",
    nonedge=0.0,
)

Source from the content-addressed store, hash-verified

183
184
185def 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
209def to_scipy_sparse_matrix(G, nodelist=None, dtype=None, weight="weight", format="csr"):

Callers

nothing calls this directly

Calls 1

to_numpy_arrayFunction · 0.85

Tested by

no test coverage detected