This video shows how to use a Python script to visualize network graphs and calculate network metrics from transaction data. It processes transaction tables with buyer and seller information to build and analyze these network structures, which is key for data analysis. Understanding the adjacency matrix and degree distribution helps in network analysis, providing insights for data science applications.
Python transaction network analysis: build an interactive buyer-seller graph with PageRank, betweenness, and supplier dependency risk.
You will generate HTML network visualizations plus ranked CSV tables you can reuse on any transaction dataset.
In this video you build:
Buyer-seller flow network from transaction CSVs
PageRank, betweenness centrality, and strength rankings
Buyer dependency risk using supplier concentration (HHI)
Buyer similarity network from shared suppliers (cosine similarity)
Interactive HTML graphs (PyVis) + clean CSV exports + a timeline plot
Prereqs:
Python 3.12.x
Libraries: numpy, pandas, networkx, matplotlib, pyvis
0:00 Demo and Outputs
2:53 Jumping to code: Theory part
4:31 Libraries and configuration
10:04 Edges and nodes from syntheitc transactions
18:36 Network metrics (PageRank, betweenness, strength, HHI)
27:53 Network visualization
31:14 Buyer similarity network (shared suppliers)
33:52 Community detection applied and visualized
35:45 Final demo
You can find the code explained in this video here: (coming soon)