Public
Edited
Jul 1, 2023
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
records = {
let arr = [];
// iterate through rows
for(let i = 0; i < df.length; i++){
// iterate through terms (Used to create new entries by terms)
for (let j = 0; j < terms.length; j++){
// create new data objects for easier processing
if (df[i]['Department'] == 'Computer Science' && termVals.indexOf(terms[j]) > -1){ // Filter records for just Computer Science Department
arr.push({
"College" : df[i]['College'],
"Department": df[i]['Department'],
"Course": df[i]["Course"],
"Term": terms[j],
"DFW Rate": df[i][terms[j] + "_DFW"],
"Repeat Rate" : df[i][terms[j] + "_RPT"],
"Enrollment Total" : df[i][terms[j] + "_ENLT"]
})
}
}
}
return arr
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
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