Published
Edited
Sep 28, 2019
Fork of Untitled
Insert cell
md`#Assignment 2`
Insert cell
d3 = require("d3@5")
Insert cell
data = d3.csv("https://www.sfu.ca/~lha54/exonerees.csv", d3.autoType)
Insert cell
md` hello bois`
Insert cell
exonerees = d3.csv("https://www.sfu.ca/~lha54/exonerees.csv", function(d) {
return {
last_name : d["Last Name"],
first_name : d["First Name"],
age : +d["Age"],
race : d["Race"],
sex : d["Sex"],
state : d["State"],
county : d["County"],
tags : d["Tags"],
worst_crime : d["Worst Crime Display"],
additional_crimes : d["List Add'l Crimes Recode"],
occurred : +d["Occurred"],
convicted : +d["Convicted"],
exonerated : +d["Exonerated"],
sentence : d["Sentence"],
DNA : d["DNA"],
false_confession : d["FC"],
mistaken_witness : d["MWID"],
false_forensics : d["F/MFE"],
false_accusation : d["P/FA"],
official_misconduct : d["OM"],
inadequate_legal_defense : d["ILD"],
posting_date : d["Posting Date"],
id : d["ID"]
}
});
Insert cell
maxAge = d3.max(exonerees, d => d.age)
Insert cell
minAge = d3.min(exonerees, d => d.age)
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more