In [12]:
2**9 * 3**3
Out[12]:
In [14]:
import os
os.getcwd()
#%run 'compute_edges_connected_components.py'
Out[14]:
In [15]:
import networkx as nx
In [16]:
g = nx.Graph()
g
Out[16]:
In [17]:
a = [[1,2,3],[4,5,6],[7,8,9]]
In [18]:
a
Out[18]:
In [19]:
[i for i in range(len(a)-1,-1,-1)]
Out[19]:
In [20]:
[i for i in range(4,4,-1)]
Out[20]:
In [21]:
x = 5==3
x
Out[21]:
In [22]:
g
Out[22]:
In [23]:
g.add_node(3)
In [27]:
g.nodes()
Out[27]:
In [25]:
def add_node(g):
g.add_node(7)
In [26]:
g.add_edge(4,6)
In [10]:
g.nodes()
Out[10]:
In [11]:
g[4]
Out[11]:
In [30]:
In [31]:
g[3]
Out[31]:
In [32]:
g.nodes[3]['attr'] = 'foo'
In [33]:
g[3]
Out[33]:
In [34]:
g.nodes[3]['attr']
Out[34]:
In [35]:
g.nodes()
Out[35]:
In [ ]:
nx.set_node_attributes(g,)