Skip to content

Instantly share code, notes, and snippets.

@jeffatennis
jeffatennis / US Zip Codes from 2013 Government Data
Created November 7, 2017 15:34 — forked from erichurst/US Zip Codes from 2013 Government Data
All US zip codes with their corresponding latitude and longitude coordinates. Comma delimited for your database goodness. Source: http://www.census.gov/geo/maps-data/data/gazetteer.html
This file has been truncated, but you can view the full file.
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
@jeffatennis
jeffatennis / dbf2DF.py
Created January 22, 2016 21:38 — forked from ryan-hill/dbf2DF.py
Import DBF file to Pandas data frame in Python
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
@jeffatennis
jeffatennis / README.md
Created December 12, 2015 13:54 — forked from rgdonohue/README.md
Batch Geocoding Script with GeoPy
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)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Population Projection</title>
<link rel="stylesheet" href="main.css">
</head>