MCPcopy Create free account
hub / github.com/breck7/scroll / mergeCSVData

Function mergeCSVData

updatePopularity.js:40–49  ·  view source on GitHub ↗
(filePaths)

Source from the content-addressed store, hash-verified

38
39// Function to merge data from multiple CSV files
40function mergeCSVData(filePaths) {
41 let mergedData = {}
42 for (let filePath of filePaths) {
43 const data = parseCSV(filePath)
44 for (let parserId in data) {
45 mergedData[parserId] = (mergedData[parserId] || 0) + data[parserId]
46 }
47 }
48 return mergedData
49}
50
51// Function to calculate popularity
52function calculatePopularity(data) {

Callers 1

mainFunction · 0.85

Calls 1

parseCSVFunction · 0.85

Tested by

no test coverage detected