mirror of
https://github.com/lynchmarkHQ/lynchmark.com.git
synced 2026-10-19 02:07:52 +00:00
Docs: Update Gemini benchmark results
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
export const processCSV = async (str, {
|
||||
filterColumn: fc,
|
||||
filterValue: fv,
|
||||
groupBy: gb,
|
||||
aggregateColumn: ac,
|
||||
operation: op
|
||||
}) => {
|
||||
const { csvParse, rollups, sum, mean } = await import('https://cdn.jsdelivr.net/npm/d3@7/+esm')
|
||||
const val = d => +d[ac] || 0
|
||||
|
||||
return rollups(
|
||||
csvParse(str).filter(d => d[fc] == fv),
|
||||
g => op === 'count' ? g.length : op === 'sum' ? sum(g, val) : mean(g, val) || 0,
|
||||
d => d[gb]
|
||||
).map(([k, r]) => ({ [gb]: k, result: r }))
|
||||
}
|
||||
export default processCSV;
|
||||
Reference in New Issue
Block a user