Notebooks 2.0 is here.

Published
Edited
May 8, 2022
1 fork
Insert cell
Insert cell
Insert cell
import {Wrangler, op} from "@observablehq/data-wrangler"
Insert cell
Insert cell
import { data as data_raw} from "bbb03d025cae847a" // ... import the 'data_raw' cell from the previous notebook using copy import
Insert cell
Insert cell
FileAttachment("temperature (1).csv").csv()
Insert cell
Inputs.table(data_raw)
Insert cell
Insert cell
Insert cell
// To use copied code replace "data" with your own variable

final_data = aq
.from(data_raw)
.orderby(aq.desc("temperature"))
.derive({ temperatureNum: (d) => +d.temperature })
.filter((d) => d["temperatureNum"] < 62)
.filter((d) => d["temperatureNum"] > 40)
.derive({ temperatureCelsius: (d) => (d.temperatureNum - 32) / 1.8 })
.select("date", "temperatureNum", "temperatureCelsius")
.rename({ temperatureNum: "temperatureFahrenheit" }) //to generate this line we opened wrangler and renamed temperatureNum to temperatureFahrenheit
.objects() // Uncomment to return an array of objects
Insert cell
Inputs.table(final_data)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
import {imageToDo} from "@clokman/student-blocks"
Insert cell
imageToDo
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