Published
Edited
Mar 1, 2020
Insert cell
Insert cell
Insert cell
df = dfjs.DataFrame.fromCSV("https://gist.githubusercontent.com/maggieliujx/1af720c19de8b80fbe038de764d65346/raw/5755269453b381b956c9497dd4e595e139513ef2/Cameras.csv")
Insert cell
cameras = df.toCollection()
Insert cell
Insert cell
Insert cell
df2 = df.replace('0','',"Max resolution").replace('0','',"Low resolution").replace('0','',"Effective pixels").replace('0','',"Zoom wide (W)").replace('0','',"Zoom tele (T)").replace('0','',"Normal focus range").replace('0','',"Macro focus range").replace('0','',"Storage included").replace('0','',"Weight (inc. batteries)").replace('0','',"Dimensions")
Insert cell
Insert cell
df2.countValue('', "Release date")
Insert cell
df2.countValue('', "Max resolution")
Insert cell
df2.countValue('', "Low resolution")
Insert cell
df2.countValue('', "Effective pixels")
Insert cell
df2.countValue('', "Zoom wide (W)")
Insert cell
df2.countValue('', "Zoom tele (T)")
Insert cell
df2.countValue('', "Normal focus range")
Insert cell
df2.countValue('', "Macro focus range")
Insert cell
df2.countValue('', "Storage included")
Insert cell
df2.countValue('', "Weight (inc. batteries)")
Insert cell
df2.countValue('', "Dimensions")
Insert cell
df2.countValue('', "Price")
Insert cell
md` With the cleaned up data, define a new cell called cameras2 by setting df2 to a new collection.`
Insert cell
cameras2 = df2.toCollection()
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
d3=require('d3@5')
Insert cell
dfjs = require('https://bundle.run/dataframe-js@1.3.2')
Insert cell
VegaLite = require('@observablehq/vega-lite')
Insert cell
md`## References`
Insert cell
Insert cell
Insert cell
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