def degree_histogram(G):
 counts = Counter((d for (n, d) in G.degree()))
 return [counts.get(i, 0) for i in range((max(counts) + 1))]

def degree_histogram ( G ) : counts = Counter ( ( d for ( n , d ) in G . degree ( ) ) ) return [ counts . get ( i , 0 ) for i in range ( ( max ( counts ) + 1 ) ) ]
return a list of the frequency of each degree value .