dynetx.DynDiGraph.out_degree_iter

DynDiGraph.out_degree_iter(nbunch=None, t=None)

Return an iterator for (node, out_degree) at time t.

The node out degree is the number of interactions outgoing from the node in a given timeframe.

Parameters

nbunchiterable container, optional (default=all nodes)

A container of nodes. The container will be iterated through once.

tsnapshot id (default=None)

If None will be returned an iterator over the degree of nodes on the flattened graph.

Returns

nd_iteran iterator

The iterator returns two-tuples of (node, degree).

See Also

degree

Examples

>>> import dynetx as dn
>>> G = dn.DynDiGraph()
>>> G.add_interaction(0, 1, t=0)
>>> list(G.out_degree_iter(0, t=0))
[(0, 1)]
>>> list(G.out_degree_iter([0,1], t=0))
[(0, 1)]