This Python script utilizes the GeoPy geocoding library to batch geocode a number of addresses, using various services until a pair of latitude/longitude values are returned.
This file has been truncated, but you can view the full file.
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
| ZIP,LAT,LNG | |
| 00601,18.180555, -66.749961 | |
| 00602,18.361945, -67.175597 | |
| 00603,18.455183, -67.119887 | |
| 00606,18.158345, -66.932911 | |
| 00610,18.295366, -67.125135 | |
| 00612,18.402253, -66.711397 | |
| 00616,18.420412, -66.671979 | |
| 00617,18.445147, -66.559696 |
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 pysal as ps | |
| import pandas as pd | |
| ''' | |
| Arguments | |
| --------- | |
| dbfile : DBF file - Input to be imported | |
| upper : Condition - If true, make column heads upper case | |
| ''' | |
| def dbf2DF(dbfile, upper=True): #Reads in DBF files and returns Pandas DF | |
| db = ps.open(dbfile) #Pysal to open DBF |
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
| from bs4 import BeautifulSoup, NavigableString | |
| from urllib2 import urlopen | |
| #Note: must be a public profile | |
| print "Twitter username:" | |
| user = raw_input() | |
| endpoint = "https://twitter.com/%s" | |
| f = urlopen(endpoint % user) |
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
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Population Projection</title> | |
| <link rel="stylesheet" href="main.css"> | |
| </head> |