Published
Edited
Nov 2, 2020
Fork of Template
1 fork
Insert cell
Insert cell
Insert cell
cars = data.filter(d => d.Name.split(" ")[0] == "chevrolet" || d.Name.split(" ")[0] == "toyota" || d.Name.split(" ")[0] == "datsun")
Insert cell
cars2 = cars.filter(d => d.Miles_per_Gallon != null)
Insert cell
d3.extent(cars2,d => d.Miles_per_Gallon)
Insert cell
Insert cell
viewof s = slider({min1:0, max:40})
Insert cell
Insert cell
Insert cell
Insert cell
FP = cars2.filter(d => d.Miles_per_Gallon < s).filter( d=> d.Name.split(" ")[0] == "toyota" || d.Name.split(" ")[0] == "datsun").length
Insert cell
TN = cars2.filter(d => d.Miles_per_Gallon >= s).filter( d=> d.Name.split(" ")[0] == "toyota" || d.Name.split(" ")[0] == "datsun").length
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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