Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 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 |
This file contains 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
{ | |
"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", |
This file contains 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 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 |