This d3.js visualization uses public data from NYC public schools. Original data available largely at http://schools.nyc.gov/Accountability/tools/report/default.htm This is a hacked-together prototype; it does not represent best practices.
This shows New York City subway usage based on turnstile data. Hovering over a day shows the number of entries through subway turnstiles in that day.
Notice the clear effects of hurricanes Irene and Sandy.
More details and source code available. Visualization based (heavily) on Mike Bostock's excellent example.
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 | |
import sys | |
import csv | |
def MeanAveragePrecision(valid_filename, attempt_filename, at=10): | |
at = int(at) | |
valid = dict() | |
for line in csv.DictReader(open(valid_filename,'r')): | |
valid.setdefault(line['source_node'],set()).update(line['destination_nodes'].split(" ")) |
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 csv | |
r = csv.reader(open('train.csv','r')) | |
r.next() | |
edges = set() | |
#commutative_graph = dict() | |
for edge in r: | |
edges.add((edge[0], edge[1])) | |
# commutative_graph.setdefault(edge[0], set()).add(edge[1]) |
NewerOlder