We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 21 columns, instead of 5 in line 8.
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
,Millions LU journeys adjusted for odd days,Millions bus journeys adjusted for odd days - new measure,Millions bus plus underground journeys adjusted for odd days - new measure,LU Average,Bus Average,LU plus bus average,LU growth,Bus growth,LU plus bus growth,LU moving average annual growth,Bus moving average annual growth,LU plus busmoving average annual growth,,,,,,,, | |
2006/2007 - 1,72.3,151.3,223.5,73.9,138.8,212.7,-5.4%,-1.5%,-2.9%,-1.6%,0.6%,-0.2%,,,,,,,, | |
2006/2007 - 2,75.6,158.9,234.5,73.8,139.1,212.9,-2.5%,3.4%,1.3%,-2.1%,0.8%,-0.2%,,,,,,,, | |
2006/2007 - 3,74.3,158.4,232.7,73.6,139.6,213.2,-2.7%,4.4%,1.9%,-2.6%,1.1%,-0.2%,,,,,,,, | |
2006/2007 - 4,77.4,161.5,238.9,74.1,140.1,214.2,8.2%,4.9%,6.0%,-1.7%,1.4%,0.3%,,,,,,,, | |
2006/2007 - 5,73.7,153.5,227.2,74.8,141.1,215.9,15.0%,9.9%,11.6%,0.2%,2.3%,1.6%,,,,,,,, | |
2006/2007 - 6,74.1,153.2,227.3,75.2,141.7,216.9,7.9%,5.8%,6.5%,1.2%,3.0%,2.3%,,,,,,,, | |
2006/2007 - 7,81.1,165.1,246.2,75.6,142.1,217.7,6.1%,4.0%,4.8%,1.8%,3.5%,2.9%,,,,,,,, | |
2006/2007 - 8,83.4,166.5,250.0,76.0 |
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
{ | |
"datasets": { | |
"adur_district_spending": { | |
"author": "Lucy Chambers", | |
"author_email": "", | |
"extras": { | |
"spatial-text": "Adur, West Sussex, South East England, England, United Kingdom", | |
"spatial": "{ \"type\": \"Polygon\", \"coordinates\": [ [ [-0.3715, 50.8168],[-0.3715, 50.8747], [-0.2155, 50.8747], [-0.2155, 50.8168], [-0.3715, 50.8168] ] ] }" | |
}, | |
"license": "License Not Specified", |
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
var jsdom = require('jsdom'); | |
var fs = require('fs'); | |
// var jquery = fs.readFileSync("./jquery-1.7.1.min.js").toString(); | |
var linklist = 'http://police.uk/data'; | |
jsdom.env({ | |
html: linklist, | |
scripts: [ | |
'http://code.jquery.com/jquery.js' |
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
''' Upload datawrangling handbook to wordpress site. | |
Copy this file to same directory as your sphinx build directory and then do | |
python upload.py -h | |
NB: You need to enable XML-RPC access to the wordpress site (via Settings -> Writing) | |
NB: this requires pywordpress (pip install pywordpress) and associated config | |
file - see https://github.com/rgrp/pywordpress |
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
{ | |
"manifest_version": 1, | |
"created": "2012-12-28T20:32:39.564Z", | |
"scripts": [ | |
{ | |
"created": "2012-12-30T19:41:43.446Z", | |
"last_modified": "2012-12-30T19:41:43.446Z", | |
"language": "javascript", | |
"content": "print(\"hello world\");\nprint('Fields: ', dataset.fields);\n// let's compute inflation\ndataset.data = _.map(dataset.data.slice(1), function(record, idx) {\n record.inflation = 100 * (dataset.data[idx+1].CDKO - dataset.data[idx].CDKO)/dataset.data[idx].CDKO;\n return record;\n});\ndataset.fields.push({id: 'inflation'});\nprint(dataset.data[0]);\nsaveDataset(dataset);\nprint('here again 6');", | |
"id": "main.js" |
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
{ | |
"manifest_version": 1, | |
"created": "2013-01-05T17:54:06.522Z", | |
"scripts": [ | |
{ | |
"created": "2013-01-05T17:54:06.523Z", | |
"last_modified": "2013-01-05T17:54:06.523Z", | |
"language": "javascript", | |
"content": "// correct the field type to date so it renders correctly\ndataset.fields[0].type = 'date';\n// save the dataset\nsaveDataset(dataset);", | |
"id": "main.js" |
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
// the location we want to GeoCode | |
var location = 'London'; | |
// we are using MapQuest's Nominatim service | |
var geocode = 'http://open.mapquestapi.com/search?format=json&q=' + location; | |
// use jQuery to call the API and get the JSON results | |
$.getJSON(geocode, function(data) { | |
// get lat + lon from first match | |
var latlng = [data[0].lat, data[0].lon] |
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
#!/usr/bin/env python | |
# A simple Python script to convert csv files to sqlite (with type guessing) | |
# | |
# @author: Rufus Pollock | |
# Placed in the Public Domain | |
import csv | |
import sqlite3 | |
def convert(filepath_or_fileobj, dbpath, table='data'): | |
if isinstance(filepath_or_fileobj, basestring): |
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 json | |
x = json.load(open('datapackage.json')) | |
finfo = x['files'][0] | |
for idx, f in enumerate(finfo['schema']['fields']): | |
print idx, f['id'] |
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
count | sum | DepartmentFamilyNameCanonical | |
---------+-----------------------+---------------------------------------------------- | |
3159056 | 393285808916.97 | Department of Health | |
238828 | 227002821119.32 | Department of Communities & Local Government | |
239218 | 179384601858.26 | Department for Education | |
197897 | 117044628895.78 | Department for Business, Innovation and Skills | |
199113 | 46335079639.94 | Department For Transport | |
35539 | 24392624386.64 | Home Office | |
55776 | 16089108023.16 | Department for International Development | |
109110 | 15738053030.67 | Ministry of Defence |