-
-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
Hello thank you for grate framework.
Please help me to resolve the issue with Series' methods min and max
Sequence of DataFrame is taken on iteration inside select method on it then it's converted to Series and everything works fine and fast before calling min and max methods on Series.
What is the best solution to this issue?
Code is below:
const data_forge_1 = require("data-forge");
function f () {
return this.select((df, i) => {
const takeSequence = this.skip(i).take(50);//.bake();
const ls = takeSequence.getSeries('l');//.bake();
const hs = takeSequence.getSeries('h');//.bake();
// with calls to min and max it's starting to work really slowly without calls it's a few seconds
const min_val = ls.min();
const max_val = hs.max();
return {min_val, max_val};
}).bake()
}
data_forge_1.DataFrame.prototype.f = f;
How it's applied:
const dataForge = require('data-forge');
require('data-forge-fs')
let inputSeries = dataForge.readFileSync("path/to/file.csv") // thousands entities
.parseCSV()
const f = inputSeries.f();
inputSeries = inputSeries
.withSeries("f", f);
Metadata
Metadata
Assignees
Labels
No labels