Published
Edited
Jan 17, 2020
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
avgScore = {
// Initialize
let avgScore = {}
for (let clas of classes) {
avgScore[clas] = {appearances: 0, score: 0};
}
// Load data
for (let team of data) {
for (let clas of team.classes) {
avgScore[clas].appearances++
avgScore[clas].score += team.score
}
}
// Renormalize
for (let clas of classes) {
avgScore[clas].score /= avgScore[clas].appearances
}
return avgScore
}
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
puppeteer = require('https://bundle.run/puppeteer')
Insert cell
Insert cell
Tabulator = require('tabulator-tables')
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