Public
Edited
Oct 23, 2024
4 forks
Day One Data in Observable
Day One JavaScript
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
taxiZones = d3.csv(
"https://raw.githubusercontent.com/columbia-data-club/data/refs/heads/main/nyc-taxi-data/taxi_zone_lookup.csv"
)
Insert cell
Insert cell
yellow_tripdata_202407First2m = FileAttachment(
"yellow_tripdata_2024-07-first-2m@2.parquet"
)
Insert cell
Insert cell
Insert cell
Insert cell
yellow_tb = aq.fromArrow(arrowTable)
Insert cell
yellow_tb.view(5)
Insert cell
Insert cell
yellow_tb.numRows()
Insert cell
Insert cell
tipPct = yellow_tb
.derive({ tipPct: (d) => d.tip_amount / d.fare_amount })
.column("tipPct")
Insert cell
avgTip = yellow_tb.rollup({ mean: (d) => op.mean(d.tip_amount) }).get("mean", 0)
Insert cell
Insert cell
Insert cell
fiveNum = (data, columnName) => {
const t = data
.select(columnName)
.orderby(columnName)
.rollup({
median: (d) => op.mean(d)
});
return t;
}
Insert cell
fiveNum(yellow_tb, "fare_amount").view()
Insert cell
Insert cell
Plot.dot(yellow_tb)
Insert cell
Insert cell
taxiZones_tb = aq.loadCSV(
"https://raw.githubusercontent.com/columbia-data-club/data/refs/heads/main/nyc-taxi-data/taxi_zone_lookup.csv"
)
Insert cell
taxiZones_tb.view()
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