dynetx.DynGraph.interactions_per_snapshots

DynGraph.interactions_per_snapshots(t=None)

Return the number of interactions within snapshot t.

Parameters:t (snapshot id (default=None)) – If None will be returned total number of interactions across all snapshots
Returns:nd – A dictionary with snapshot ids as keys and interaction count as values or a number if a single snapshot id is specified.
Return type:dictionary, or number

Examples

>>> G = dn.DynGraph()
>>> G.add_path([0,1,2,3], t=0)
>>> G.add_path([0,4,5,6], t=1)
>>> G.add_path([7,1,2,3], t=2)
>>> G.interactions_per_snapshots(t=0)
3
>>> G.interactions_per_snapshots()
{0: 3, 1: 3, 2: 3}