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)
@jeffatennis
jeffatennis / gist:b7fc6501d80647968516
Created October 19, 2015 14:21
Marriage Evaluation
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"###Supervised Learning: Logistic Regression\n",
"\n",
"-In this code, we use a simple binary dataset (i.e. emails classified as either \"junk\" or \"not junk\")"
]
@jeffatennis
jeffatennis / gist:a64e0464566d0d05ec2b
Created August 21, 2015 22:16
Election Script JT
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Election Data Project - Polls and Donors\n",
"\n",
"In this Data Project we will be looking at data from the 2012 election.\n",
"\n",
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Data Project - Stock Market Analysis"
]
},
{
@jeffatennis
jeffatennis / Titanic_20150801
Created August 1, 2015 12:43
Titanic_KaggleDataAnalysis
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@jeffatennis
jeffatennis / CSVSummarizer
Created July 22, 2015 02:03
Import and Summarize Basic CSV file
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
@jeffatennis
jeffatennis / USGSEvaluator
Created July 9, 2015 13:16
IPython Methods of Grouping Describe Pivot
{
"cells": [
{
"cell_type": "code",
"execution_count": 28,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [