dynetx.DynDiGraph.nodes_iter

DynDiGraph.nodes_iter(t=None)

Return an iterator over the nodes with respect to a given temporal snapshot.

Parameters:t (snapshot id (default=None)) – If None the iterator returns all the nodes of the flattened graph.
Returns:niter – An iterator over nodes. If data=True the iterator gives two-tuples containing (node, node data, dictionary)
Return type:iterator

Examples

>>> import dynetx as dn
>>> G = dn.DynDiGraph()
>>> G.add_interaction(0,1, 0)
>>> G.add_interaction(1,2, 0)
>>> [n for n, d in G.nodes_iter(t=0)]
[0, 1, 2]