Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,16 @@ UI.md

# Examples
examples/

# Test fixtures
test/fixtures

# Documentation
docs/

# Test and demo files
arrow-demo.cjs
arrow-test.cjs
test-arrow.js
test-output/
tinyframejs-*.tgz
149 changes: 0 additions & 149 deletions arrow-demo.cjs

This file was deleted.

77 changes: 0 additions & 77 deletions arrow-test.cjs

This file was deleted.

2 changes: 1 addition & 1 deletion docs/io-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ async function getBitcoinPrices() {
const standardized = applySchema(data, binanceOHLCV);

// Преобразование в DataFrame
return DataFrame.fromRows(standardized);
return DataFrame.fromRecords(standardized);
}

// Использование
Expand Down
89 changes: 0 additions & 89 deletions fix-test-imports.js

This file was deleted.

9 changes: 6 additions & 3 deletions src/core/dataframe/DataFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
value: {
/**
* low-level vector getter (internal)
* @param n
* @param {string} n - Column name
* @returns {import('../storage/ColumnVector.js').ColumnVector|undefined} - Column vector or undefined if not found

Check warning on line 34 in src/core/dataframe/DataFrame.js

View workflow job for this annotation

GitHub Actions / build-test-lint

This line has a length of 123. Maximum allowed is 100
*/
getColumn: (n) => this._columns[n]?.vector,
},
Expand All @@ -44,7 +45,7 @@
static create = (cols, opts = {}) => new DataFrame(cols, opts);
static fromColumns = (cols, opts = {}) => new DataFrame(cols, opts);

static fromRows(rows = [], opts = {}) {
static fromRecords(rows = [], opts = {}) {
if (!rows.length) return new DataFrame({}, opts);
const cols = {};
for (const k of Object.keys(rows[0])) cols[k] = rows.map((r) => r[k]);
Expand Down Expand Up @@ -90,10 +91,12 @@
}

col = (n) => this._columns[n];
get = (n) => this._columns[n];
sum = (n) => this.col(n).sum();
/**
* low-level vector getter
* @param n
* @param {string} n - Column name
* @returns {import('../storage/ColumnVector.js').ColumnVector|undefined} - Column vector or undefined if not found

Check warning on line 99 in src/core/dataframe/DataFrame.js

View workflow job for this annotation

GitHub Actions / build-test-lint

This line has a length of 117. Maximum allowed is 100
*/
getVector = (n) => this._columns[n]?.vector;

Expand Down
Loading
Loading