dynetworkx.SnapshotGraph.number_of_nodes

SnapshotGraph.number_of_nodes(sbunch=None)

Gets number of nodes in each snapshot requested in ‘sbunch’.

Parameters:sbunch (container of snapshot indexes, optional (default= None)) – Each snapshot index in this list will be included in the returned list of number of nodes in the snapshot. It is highly recommended that this list is sequential, however it can be out of order.
Returns:num_nodes – A list of of the number of nodes in each requested snapshot.
Return type:list

Examples

>>> G = dnx.SnapshotGraph()
>>> G.add_snapshot([(1, 2), (1, 3)])
>>> G.add_snapshot([(1, 4), (1, 3)])
>>> G.number_of_nodes(sbunch=[1])
[3]
>>> G.number_of_nodes(sbunch=[0, 1])
[3, 3]