Created
July 4, 2017 11:41
-
-
Save saliksyed/7dadbbef2d7adf49f27c6a21c669953d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import numpy as np | |
import matplotlib.pyplot as plt | |
graph_data = json.loads(open("routes.json").read()) | |
belgium_count = [] | |
switzerland_count = [] | |
for start_country in graph_data: | |
data = graph_data[start_country] | |
if "Belgium" in data["to"]: | |
belgium_count.append(data["to"]["Belgium"]) | |
else: | |
belgium_count.append(0) | |
if "Switzerland" in data["to"]: | |
switzerland_count.append(data["to"]["Switzerland"]) | |
else: | |
switzerland_count.append(0) | |
x = belgium_count | |
y = switzerland_count | |
plt.scatter(x, y) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment