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.