📜  networkx - 计算每个节点的度数 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:31.176000             🧑  作者: Mango

代码示例1
# Degree
degrees = [val for (node, val) in G.degree()]

# Sorted degree
degrees = [val for (node, val) in sorted(G.degree(), key=lambda pair: pair[0])]