Networkx - рассчитайте степень на каждый узел
# 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])]
Andrea Perlato