Skip to content

Instantly share code, notes, and snippets.

View domdip's full-sized avatar

Dominic domdip

View GitHub Profile

Keybase proof

I hereby claim:

  • I am domdip on github.
  • I am ddd (https://keybase.io/ddd) on keybase.
  • I have a public key ASD6dzdsJCUlnDJ6fxImqF8fxdo9kAow5cCjqPByr9bljwo

To claim this, I am signing this object:

@domdip
domdip / megacities.py
Created January 27, 2013 06:11
Of countries that contain megacities (urbanized areas >= 10M), what percentage of their population lives in such areas? Uses 2012 estimates from Demographia World Urban Areas and Wikipedia. Output in comments toward the bottom.
#!/usr/bin/python
from collections import defaultdict
def main():
#From http://www.newgeography.com/content/002808-world-urban-areas-population-and-density-a-2012-update
citydata = """
1 Japan Tokyo-Yokohama 37,126,000 3,300 11,300 8,547 4,300
2 Indonesia Jakarta 26,063,000 1,075 24,200 2,784 9,400
3 South Korea Seoul-Incheon 22,547,000 835 27,000 2,163 10,400
4 India Delhi, DL-HR-UP 22,242,000 750 29,700 1,943 11,500