Public
Edited
Mar 6, 2023
Importers
Insert cell
Insert cell
Insert cell
workbook = FileAttachment("Bio-Info-Science.xlsx").xlsx()
Insert cell
sheetsnames = workbook.sheetNames
Insert cell
sheets_headers_true = sheetsnames.map(x => workbook.sheet(x, {headers: true}))
Insert cell
sheets_headers_false = sheetsnames.map(x => workbook.sheet(x, {headers: false}))
Insert cell
sheetsObj = sheetsnames.reduce((prev, curr) => {
prev[curr] = workbook.sheet(curr, {headers:true});
return prev;
}, {});
Insert cell
sheetsMap = new Map(sheetsnames.map(x => [x,workbook.sheet(x, {headers: true})]))
Insert cell
Insert cell
filtered_sheets = sheets_headers_true.filter(x =>x.columns.includes("Longitude") && x.columns.includes("Latitude"))
Insert cell
invalid_sheets = sheets_headers_true.filter(x =>! (x.columns.includes("Longitude") && x.columns.includes("Latitude")))
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
dummy = FileAttachment("dummy2@1.xlsx").xlsx()
Insert cell
dummynames = dummy.sheetNames
Insert cell
dummyMap = new Map(dummynames.map(x => [x, dummy.sheet(x, {headers: true})]))
Insert cell
category = dummy.sheet("Sheet3", {headers: true}).map(x => x["name"])
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
viewof select = Inputs.select(category, {label: "Category:"})
Insert cell
Insert cell
Insert cell
md`# Modifying Derek's Data`
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
sheets_headers_true[0].columns
Insert cell
Object.values(sheets_headers_true[0].columns)
Insert cell
sheets_headers_true[0].columns.includes("Latitude")
Insert cell
"Latitude" in Object.values(sheets_headers_true[0].columns)
Insert cell
"0" in sheets_headers_true[0].columns
Insert cell
sheets_headers_true.filter(x =>"Longitude" in x.columns)
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