code
stringlengths
3
6.57k
G.add_edges_from( ((2,2)
G.edges()
ThinGraph(nx.Graph)
single_edge_dict(self)
ThinGraph()
G.add_edge(2,1)
G.edges(data= True)
G.add_edge(2,2)
__init__(self, data=None, **attr)
None (default)
optional (default='')
optional (default= no attributes)
nx.Graph()
nx.Graph(name='my graph')
nx.Graph(e)
pairs (key=value)
nx.Graph(e, day="Friday")
ndf()
ndf()
ndf()
convert.to_networkx_mod_graph(data,create_using=self)
attributes (must be after convert)
self.graph.update(attr)
add_node(self, n, attr_dict=None, **attr)
optional (default= no attributes)
nx.Graph()
G.add_node(1)
G.add_node('Hello')
nx.Graph([(0,1)
G.add_node(K3)
G.number_of_nodes()
G.add_node(1,size=10)
G.add_node(3,weight=0.4,UTM=('13S',382871,3972649)
attr_dict.update(attr)
self.adjlist_dict_factory()
self.adjlist_dict_factory()
update(attr_dict)
add_nodes_from(self, nodes, **attr)
nodes (list, dict, set, etc.)
of (node, attribute dict)
optional (default= no attributes)
nx.Graph()
G.add_nodes_from('Hello')
nx.Graph([(0,1)
G.add_nodes_from(K3)
sorted(G.nodes()
G.add_nodes_from([1,2], size=10)
G.add_nodes_from([3,4], weight=0.4)
Use (node, attrdict)
G.add_nodes_from([(1,dict(size=11)
nx.Graph()
H.add_nodes_from(G.nodes(data=True)
self.adjlist_dict_factory()
self.adjlist_dict_factory()
attr.copy()
update(attr)
self.adjlist_dict_factory()
self.adjlist_dict_factory()
attr.copy()
newdict.update(ndict)
olddict.update(attr)
olddict.update(ndict)
remove_node(self, n)
nx.Graph()
G.add_path([0,1,2])
G.edges()
G.remove_node(1)
G.edges()
NetworkXError("The node %s is not in the digraph."%(n,)
remove_nodes_from(self, nbunch)
nodes (list, dict, set, etc.)
nx.Graph()
G.add_path([0,1,2])
G.nodes()
G.remove_nodes_from(e)
G.nodes()
add_edge(self, u, v, attr_dict=None, **attr)
hashable (and not None)
optional (default= no attributes)
data (or labels or objects)
nx.Graph()
G.add_edge(1, 2)
G.add_edge(*e)
G.add_edges_from( [(1,2)
G.add_edge(1, 2, weight=3)
G.add_edge(1, 3, weight=7, capacity=15, length=342.7)
attr_dict.update(attr)
self.adjlist_dict_factory()
self.adjlist_dict_factory()
self.adjlist_dict_factory()
self.adjlist_dict_factory()
get(v,self.edge_attr_dict_factory()
datadict.update(attr_dict)
add_edges_from(self, ebunch, attr_dict=None, **attr)
tuples (u,v)
tuples (u,v,d)
optional (default= no attributes)
data (or labels or objects)
nx.Graph()
G.add_edges_from([(0,1)