Public
Edited
Nov 15, 2023
Insert cell
Insert cell
url = "https://raw.githubusercontent.com/scls19fr/krp_python_telemetry/main/Logdata%20Essay%20mini60%202023-10-31.csv"
Insert cell
parsed = fetch(url)
.then(response => response.text())
.then(text => {
// Normalize line breaks and split segments by double line breaks.
const [metaText, columns, rows] = text.replace(/\r?\n/g, "\n").split(/\n\n/);
// Parse first meta section as csv, then convert to an object
const meta = Object.fromEntries(d3.csvParseRows(metaText));
// Parse the two lines from the headers segment
const [headers, units] = d3.csvParseRows(columns);
// Parse the rows segment into an untyped array of arrays.
const data = d3.csvParseRows(rows);
return {meta, headers, units, data};
})
Insert cell
parsed["meta"]
Insert cell
parsed["headers"]
Insert cell
parsed["units"]
Insert cell
parsed["data"]
Insert cell
import {print} from "@visnup/hello-danfo-js"
Insert cell
dfd = require("danfojs@1.0.5/lib/bundle.js").catch(() => {
window.dfd.Series.prototype.print = window.dfd.DataFrame.prototype.print = function () {
return print(this);
};
return window.dfd;
})
Insert cell
dfd.DataFrame(parsed["data"], {columns: parsed["headers"]})
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