This commit is contained in:
Boki 2025-06-11 10:38:05 -04:00
parent 597c6efc9b
commit 8b5e06954a
26 changed files with 532 additions and 186 deletions

View file

@ -35,7 +35,9 @@ export class DataFrame {
}
private inferColumns(): string[] {
if (this.data.length === 0) {return [];}
if (this.data.length === 0) {
return [];
}
const columns = new Set<string>();
for (const row of this.data) {
@ -46,7 +48,9 @@ export class DataFrame {
}
private validateAndCleanData(): void {
if (this.data.length === 0) {return;}
if (this.data.length === 0) {
return;
}
// Ensure all rows have the same columns
for (let i = 0; i < this.data.length; i++) {
@ -224,7 +228,9 @@ export class DataFrame {
const aVal = a[column];
const bVal = b[column];
if (aVal === bVal) {return 0;}
if (aVal === bVal) {
return 0;
}
const comparison = aVal > bVal ? 1 : -1;
return ascending ? comparison : -comparison;