I have a graph stored in adjacency list format. I randomly select a bunch of nodes and notice the number of neighbors, each of which has. Now I want to build a distribution, and the way I'm doing it right now is to manually check if the size of the neighboring set falls into a specific bucket (I set the bucket sizes manually, and this verification process leads to a bunch of very ugly if-then-else ), and then increase the frequency accordingly. Then I call matplotlib and plot the graph. This whole process seems really cumbersome, and not generally pythonic. This is fully doable in Excel, but I try to make it as programmatic as possible.
I am sure that there is a better way to do this, but I could not find anything related to frequency construction. Any suggestions would be great.
Dopey source share