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

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more