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
/* requires D3 + https://github.com/Caged/d3-tip */ | |
d3.scatterplot = function() { | |
function scatterplot(selection) { | |
selection.each(function(d, i) { | |
//options | |
var data = (typeof(data) === "function" ? data(d) : d.data), | |
margin = (typeof(margin) === "function" ? margin(d) : d.margin), | |
axes = (typeof(axes) === "function" ? axes(d) : d.axes), | |
minmax = (typeof(minmax) === "function" ? minmax(d) : d.minmax), | |
size = (typeof(size) === "function" ? size(d) : d.size); |
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 csv | |
import json | |
lastgroup = '' | |
data = [] | |
i = 0 | |
dReader = csv.reader(open('data.csv'),delimiter=",") | |
for row in dReader: | |
if row[5].strip() != lastgroup: | |
if i != 0: |
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
// calculates exact binomial confidence intervals (4 decimal digits) | |
// http://statpages.org/confint.html | |
function CalcBinL(x,N,vTL,vTU) { | |
vTL = typeof vTL !== 'undefined' ? vTL : 0.25; | |
vTU = typeof vTU !== 'undefined' ? vTU : 0.25; | |
var vx = x | |
var vN = N | |
var vP = vx/vN | |
P= vP |

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 json | |
from operator import itemgetter | |
import csv | |
with open("cz2014towns.json") as infile: | |
results = json.load(infile) | |
data = {} | |
datatotal = {} | |
for town in results: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<!--<script src="d3.v3.js"></script>--> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <!-- note: http://stackoverflow.com/questions/20032426/fontawesome-doesnt-display-in-firefox --> | |
</head> |
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 csv | |
import json | |
lastgroup = '' | |
data = [] | |
i = 0 | |
dReader = csv.reader(open('data.csv'),delimiter=",") | |
for row in dReader: | |
if row[5].strip() != lastgroup: | |
if i != 0: |

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
# calculates optimal numbers of representives for hemicycle chart | |
import math | |
import csv | |
import numpy as np | |
import timeit | |
start = timeit.default_timer() | |
#benchmark: | |
#n0 = 200 : 4:23s, 5:52s, 6:132s, 7:285s, 8:579s, 9:1167s , 10:2342s, 11: 4632s |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.