本文簡要介紹
networkx.Graph.__len__
的用法。用法:
Graph.__len__()
返回圖中的節點數。使用:‘len(G)’。
- nnodes:int
圖中的節點數。
返回:
例子:
>>> G = nx.path_graph(4) # or DiGraph, MultiGraph, MultiDiGraph, etc >>> len(G) 4
相關用法
- Python NetworkX Graph.__contains__用法及代碼示例
- Python NetworkX Graph.__init__用法及代碼示例
- Python NetworkX Graph.__iter__用法及代碼示例
- Python NetworkX Graph.__getitem__用法及代碼示例
- Python NetworkX Graph.size用法及代碼示例
- Python NetworkX Graph.to_undirected用法及代碼示例
- Python NetworkX Graph.degree用法及代碼示例
- Python NetworkX Graph.number_of_edges用法及代碼示例
- Python NetworkX Graph.add_weighted_edges_from用法及代碼示例
- Python NetworkX Graph.subgraph用法及代碼示例
- Python NetworkX Graph.nodes用法及代碼示例
- Python NetworkX Graph.number_of_nodes用法及代碼示例
- Python NetworkX Graph.clear用法及代碼示例
- Python NetworkX Graph.add_edge用法及代碼示例
- Python NetworkX Graph.has_node用法及代碼示例
- Python NetworkX Graph.add_node用法及代碼示例
- Python NetworkX Graph.edges用法及代碼示例
- Python NetworkX Graph.remove_nodes_from用法及代碼示例
- Python NetworkX Graph.remove_edge用法及代碼示例
- Python NetworkX Graph.remove_node用法及代碼示例
- Python NetworkX Graph.edge_subgraph用法及代碼示例
- Python NetworkX Graph.to_directed用法及代碼示例
- Python NetworkX Graph.order用法及代碼示例
- Python NetworkX Graph.add_edges_from用法及代碼示例
- Python NetworkX Graph.update用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.Graph.__len__。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。