networkx.LabeledDiGraph.number_of_edges
networkx.LabeledDiGraph.degree
Return the number of selfloop edges (edge from a node to itself).
Examples
>>> G=nx.Graph() >>> G.add_edge(1,1) >>> G.add_edge(1,2) >>> G.number_of_selfloops() 1