Skip to content

Instantly share code, notes, and snippets.

@datarocks
datarocks / Ward_69.json
Last active July 30, 2019 01:36
South Madison Voters Wards
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@datarocks
datarocks / hashtag_stack.py
Last active May 24, 2017 03:29
a quick script to parse out hashtags from instagram captions in a csv
import os, codecs
import tablib
from itp import itp
from copy import deepcopy
original_file = 'C_000.CSV'
# This is to remove the pointless BOM (byte order mark) that windows helpfully puts at the beginning of many UTF8 files
@datarocks
datarocks / town_hall_map.json
Last active February 5, 2017 17:15
Town Hall maps
{
"features": [{
"geometry": {
"coordinates": [-112.073896, 33.56109],
"type": "Point"
},
"properties": {
"address": "8525 N Central Ave, Phoenix, AZ 85020",
"date": "Saturday, February 4, 2017",
"district": "AZ-9\n",
@datarocks
datarocks / hashtag_stack.py
Created January 7, 2017 03:57
a data munging script using tablib
import tablib
from copy import deepcopy
# pull the data in, using tablib, a really great library for messing around with tabular data
# more details about tablib here: http://docs.python-tablib.org/en/latest/).
# For serious data analysis, you are going to need to mess around with pandas http://pandas.pydata.org/
data = tablib.Dataset().load(open('picodash_instagram_nra_blog_2016-12-14.csv').read())
# make the headers for the new dataset, there has to be a more elegant way to do this, but this works
headers = data.headers