forked from ysmoll/Complex_Systems
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathanalyse_cities.py
More file actions
28 lines (19 loc) · 822 Bytes
/
Copy pathanalyse_cities.py
File metadata and controls
28 lines (19 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from networks import get_city_network, get_network_stats
import pandas as pd
import networkx as nx
city_list = ["Kaunas, Lithuania", "Bangkok, Thailand", "Manila, the Philippines", "Ulaanbaatar, Mongolia",
"Melbourne, Australia",
"Oslo, Norway", "Amsterdam, the Netherlands",
"Las Vegas, NV, USA", "Phoenix, AZ, USA", "Monterrey, Mexico",
"Manaus, Brazil", "Asunción, Paraguay",
"Lagos, Nigeria", "Kampala, Uganda",
"Riyadh, Saudi Arabia", "Sana'a, Yemen", "Berlin, Germany"]
df = pd.DataFrame()
for city in city_list:
print(city)
G = get_city_network(city)
stats_df = get_network_stats(G, osmnx = True)
df = df.append(stats_df)
df.to_csv(city + ".csv")
df["city"] = city_list
df.to_csv("city_results.csv")