Published
Edited
Jan 29, 2019
9 forks
Importers
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
df = dfjs.DataFrame.fromCSV('https://gist.githubusercontent.com/SFU-IAT355/8359599c1f5fbbbdc32028cd224fe827/raw/2d47488ed13afb4b55db02c9ab17b43351b20b1a/gistfile1.txt')
Insert cell
Insert cell
Insert cell
Insert cell
cereals = df.toCollection()
Insert cell
Insert cell
Test = VegaLite({
data: {values: cereals},
mark: "bar",
encoding: {
x: {
bin: true,
field: "% from sugar",
type: "quantitative"
},
y: {
aggregate: "count",
type: "quantitative"
}
}
})
Insert cell
Insert cell
Insert cell
df.show(40)
Insert cell
Insert cell
df2 = df.replace('-99','',"rating")
Insert cell
Insert cell
Insert cell
df2.countValue('', "weight")
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
cereals2 = df2.toCollection()
Insert cell
Insert cell
DOM.download( new Blob([d3.csvFormat(cereals2)], {type:"text/csv"}), "Cereals.csv")
Insert cell
Insert cell
dfjs = require('https://bundle.run/dataframe-js@1.3.2')
Insert cell
VegaLite = require('@observablehq/vega-lite')
Insert cell
d3 = require('d3@5')
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