Published
Edited
Apr 2, 2022
1 fork
Importers
10 stars
Insert cell
# Using Danfo.js on Observable
Insert cell
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
Insert cell
Insert cell
Insert cell
function div(fn) {
const d = html`<div>`;
fn(d);
return d;
}
Insert cell
Insert cell
remoteFile = "https://raw.githubusercontent.com/javascriptdata/danfojs/dev/src/danfojs-node/test/samples/titanic.csv";
Insert cell
df = await dfd.readCSV(remoteFile);
Insert cell
print(df.head())
Insert cell
Insert cell
df.dtypes
Insert cell
df.columns
Insert cell
df.shape
Insert cell
print(df["Survived"])
Insert cell
print(df.describe())
Insert cell
print(df.groupby(["Sex"]).count())
Insert cell
print(df.query(df["Age"].lt(10)))
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

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