Graph.degree_matrix

Graph.degree_matrix(rtype='array')[source]

Creates a degree matrix from a Graph datastructure.

Parameters:
rtypeLiteral[‘array’, ‘csc’, ‘csr’, ‘coo’, ‘list’], optional

Format of the result.

Returns:
array_like

Constructed degree matrix.