本文簡要介紹
networkx.Graph.remove_edge
的用法。用法:
Graph.remove_edge(u, v)
刪除 u 和 v 之間的邊。
- u, v:節點
刪除節點 u 和 v 之間的邊。
- NetworkXError
如果 u 和 v 之間沒有邊。
參數:
拋出:
例子:
>>> G = nx.path_graph(4) # or DiGraph, etc >>> G.remove_edge(0, 1) >>> e = (1, 2) >>> G.remove_edge(*e) # unpacks e from an edge tuple >>> e = (2, 3, {"weight": 7}) # an edge with attribute data >>> G.remove_edge(*e[:2]) # select first part of edge tuple
相關用法
- Python NetworkX Graph.remove_edges_from用法及代碼示例
- Python NetworkX Graph.remove_nodes_from用法及代碼示例
- Python NetworkX Graph.remove_node用法及代碼示例
- 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.__contains__用法及代碼示例
- 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.__len__用法及代碼示例
- Python NetworkX Graph.__init__用法及代碼示例
- Python NetworkX Graph.edge_subgraph用法及代碼示例
- Python NetworkX Graph.__iter__用法及代碼示例
- Python NetworkX Graph.to_directed用法及代碼示例
- Python NetworkX Graph.order用法及代碼示例
- Python NetworkX Graph.add_edges_from用法及代碼示例
- Python NetworkX Graph.update用法及代碼示例
注:本文由純淨天空篩選整理自networkx.org大神的英文原創作品 networkx.Graph.remove_edge。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。