Public
Edited
Jun 8, 2023
Insert cell
Insert cell
Insert cell
Plot.plot({
marks: [Plot.dot(df2, { x: "Date", y: "value" })]
})
Insert cell
df2 = Array.from(df).map((d) => {
d.Date = new Date(d.Date);
return d;
})
Insert cell
new Date(1609488000000)
Insert cell
df.schema.fields[0].type.toString().startsWith("abc")
Insert cell
df.schema.fields
.filter((d) => d.type.toString().startsWith("Timestamp"))
.map((d) => d.name)
Insert cell
Array.from(df)
Insert cell
df = arrow.tableFromIPC(await FileAttachment("out.arrow").arrayBuffer())
Insert cell
Insert cell
Plot.plot({
marks: [Plot.dot(rainfall, { x: "date", y: "precipitation" })]
})
Insert cell
Array.from(rainfall)
Insert cell
Insert cell
Insert cell
rainAmounts = Float32Array.from({ length: LENGTH }, () =>
Number((Math.random() * 20).toFixed(1))
)
Insert cell
rainDates = Array.from(
{ length: LENGTH },
(_, i) => new Date(Date.now() - 1000 * 60 * 60 * 24 * i)
)
Insert cell
Insert cell
arrow = require("apache-arrow")
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more