Previous topic

neighbors_data_iter

Next topic

attributeValueDeal

This Page

attributeCount

nepidemix.utilities.networkxtra.attributeCount(iterator, attr)

Count frequencies of a given set of possible values for some node or edge attribute.

Parameters :

iterator : networkx.Graph.nodes_iter or networx.Graph.edges_iter

A networkx node or edge iterator. Note that the iterator functions must be called with data=True. Use neighbour_data_iter in this module to get an iterator over nearest neighbours.

attr : hashable

The name of the attribute to count.

Returns :

scount :dict :

Dictionary of attribute value : count.