Read the Data, Build a Bipartite Network

As always, the script starts with a fat chunk of import statements.

 import​ ​pandas​ ​as​ ​pd
 import​ ​numpy​ ​as​ ​np
 import​ ​networkx​ ​as​ ​nx
 from​ ​networkx.algorithms.bipartite​ ​import​ sets, weighted_projected_graph
 from​ ​networkx.drawing.nx_agraph​ ​import​ graphviz_layout
 import​ ​scipy.spatial.distance​ ​as​ ​dist
 from​ ​scipy.stats​ ​import​ pearsonr
 import​ ​community
 import​ ​generalized
 import​ ​dzcnapy_plotlib​ ​as​ ​dzcnapy
 import​ ​matplotlib.pyplot​ ​as​ ​plt

Boston’s Justice Resource Institute generously provided the dataset for this project.[55] You can find it in the file jri_data.csv. The file is a correctly formatted CSV table with standard ...

Get Complex Network Analysis in Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.