Public
Edited
Oct 30, 2023
Insert cell
Insert cell
Insert cell
compressCsvToJson = import("https://cdn.skypack.dev/compress-csv-to-json")
Insert cell
Insert cell
Insert cell
Insert cell
compressedData = compressCsvToJson.compressData(sampleData, [
{ key: "oa21cd", colType: "interned_string" },
{ key: "lsoa21cd", colType: "string" },
{ key: "msoa21cd", colType: "string" },
{ key: "ltla21cd", colType: "string" },
{ key: "lng", colType: 10000 },
{ key: "lat", colType: 10000 },
{ key: "population", colType: "int" }
])
Insert cell
Insert cell
decompressedData = compressCsvToJson.decompressData(
compressedData,
(columnData, rowNumber) => ({
oa21cd: columnData[0][rowNumber],
lsoa21cd: columnData[1][rowNumber],
msoa21cd: columnData[2][rowNumber],
ltla21cd: columnData[3][rowNumber],
lng: columnData[4][rowNumber],
lat: columnData[5][rowNumber],
population: columnData[6][rowNumber]
})
)
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