Skip to content

Commit 61912c6

Browse files
committed
change tensorflow version
1 parent 39bc730 commit 61912c6

10 files changed

Lines changed: 166 additions & 463 deletions

File tree

danfojs/src/core/frame.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import Ndframe from "./generic"
22
import { Series } from "./series"
3-
import * as tf from '@tensorflow/tfjs-node'
4-
// import * as tf from '@tensorflow/tfjs'
3+
// import * as tf from '@tensorflow/tfjs-node'
4+
import * as tf from '@tensorflow/tfjs'
55
import { Utils } from "./utils"
66
import { GroupBy } from "./groupby"
77

danfojs/src/core/generic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as tf from '@tensorflow/tfjs-node'
2-
// import * as tf from '@tensorflow/tfjs'
1+
// import * as tf from '@tensorflow/tfjs-node'
2+
import * as tf from '@tensorflow/tfjs'
33
import { table } from 'table'
44
import { Utils } from './utils'
55
import { Configs } from '../config/config'

danfojs/src/core/series.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import * as tf from '@tensorflow/tfjs-node'
1+
// import * as tf from '@tensorflow/tfjs-node'
22
import { std, variance } from 'mathjs'
3-
// import * as tf from '@tensorflow/tfjs'
3+
import * as tf from '@tensorflow/tfjs'
44
import { Utils } from "./utils"
55
import { Str } from "./strings"
66
import NDframe from "./generic"
@@ -973,9 +973,10 @@ export class Series extends NDframe {
973973
* @return {Number}
974974
*/
975975
argmax() {
976-
let sorted_index = this.sort_values({ ascending: true }).index
977-
let last_idx = sorted_index[sorted_index.length - 1]
978-
return last_idx
976+
// let sorted_index = this.sort_values({ ascending: true }).index
977+
// let last_idx = sorted_index[sorted_index.length - 1]
978+
return this.values.map((x, i) => [x, i]).reduce((r, a) => (a[0] > r[0] ? a : r))[1];
979+
// return last_idx
979980
}
980981

981982

danfojs/src/core/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import * as tf from '@tensorflow/tfjs-node'
2-
// import * as tf from '@tensorflow/tfjs'
1+
// import * as tf from '@tensorflow/tfjs-node'
2+
import * as tf from '@tensorflow/tfjs'
33
import { Configs } from '../config/config'
44

55

danfojs/src/io/reader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DataFrame } from '../core/frame'
2-
import * as tf from '@tensorflow/tfjs-node'
2+
import * as tf from '@tensorflow/tfjs'
33
import fetch from "node-fetch"
44
import fs from 'fs'
55

danfojs/src/preprocessing/scalers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as tf from '@tensorflow/tfjs-node'
1+
import * as tf from '@tensorflow/tfjs'
22
import { Series } from "../core/series"
33
import { DataFrame } from "../core/frame"
44
import { Utils} from "../core/utils"

danfojs/src/preprocessing/text.js

Lines changed: 0 additions & 13 deletions
This file was deleted.

danfojs/tests/core/series.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { assert } from "chai"
22
import { Series } from '../../src/core/series'
3-
import * as tf from '@tensorflow/tfjs-node'
4-
// import * as tf from '@tensorflow/tfjs'
3+
// import * as tf from '@tensorflow/tfjs-node'
4+
import * as tf from '@tensorflow/tfjs'
55

66

77

@@ -125,7 +125,7 @@ describe("Series", function () {
125125
let data2 = [1, 2, 3, 4, 5, 6]
126126
let sf = new Series(data)
127127
let sf2 = new Series(data2)
128-
assert.throws(() => { sf.add(sf2) }, Error, " Incompatible shapes: [4] vs. [6]")
128+
assert.throws(() => { sf.add(sf2) }, Error, "Operands could not be broadcast together with shapes 4 and 6")
129129
})
130130

131131
})
@@ -155,7 +155,7 @@ describe("Series", function () {
155155
let data2 = [1, 2, 3, 4, 5, 6]
156156
let sf = new Series(data)
157157
let sf2 = new Series(data2)
158-
assert.throws(() => { sf.sub(sf2) }, Error, " Incompatible shapes: [4] vs. [6]")
158+
assert.throws(() => { sf.sub(sf2) }, Error, "Operands could not be broadcast together with shapes 4 and 6")
159159
})
160160

161161
})
@@ -398,7 +398,7 @@ describe("Series", function () {
398398
it("Computes the descriptive statistics on an int Series", function () {
399399
let data1 = [10, 45, 56, 25, 23, 20, 10]
400400
let sf = new Series(data1)
401-
assert.deepEqual(sf.describe().values, [7, 27.000001907348633, 17.378147196982766, 10, 23, 56, 302])
401+
assert.deepEqual(sf.describe().values, [7, 27, 17.378147196982766, 10, 23, 56, 302])
402402
})
403403
it("Computes the descriptive statistics on a float Series", function () {
404404
let data1 = [30.1, 40.2, 3.1, 5.1]

0 commit comments

Comments
 (0)