Skip to content
I clustered countries by Wikipedia references - here's what happened
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.DS_Store
README.md
country-clusters-large-lables.png
country-clusters.pdf
country-clusters.png
graph.gephi
graphfile.csv
nation_rels.csv
nations.csv
nations.py
newnationscrape.py

README.md

Scraping Sovereign States on Wikipedia to See Relationships

This is some python code I used to create a neat visualization detailing the relationships countries have to each other. A relationship between two countries is created when country A's Wikipedia page mentions country B. The weight of this relationship is the number of mentions on that page. All relationships are directional.

I used the CSV files that this scraper creates to build a data visualization in Gephi. Here is my final product.

The Final Graph

I used a Force Atlas in LinLog mode (creates tighter clusters), and set it to No-Overlap. The node sizes are determined by In-Degree and the colors of the nodes are determined by their modularity class.

Check out the write-up on my blog here.

You can’t perform that action at this time.