Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/javascriptdata/danfojs into …
Browse files Browse the repository at this point in the history
…JanKaul-esmodule
  • Loading branch information
risenW committed Mar 8, 2022
2 parents 23243dd + c9cc17d commit 8ebf233
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
2 changes: 1 addition & 1 deletion src/danfojs-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"eslint": "^7.1.0",
"ify-loader": "^1.1.0",
"install-peers": "^1.0.3",
"karma": "6.3.14",
"karma": "6.3.16",
"karma-browserify": "7.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
Expand Down
9 changes: 5 additions & 4 deletions src/danfojs-base/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4412,10 +4412,10 @@ karma-mocha@^2.0.1:
dependencies:
minimist "^1.2.3"

[email protected].14:
version "6.3.14"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.14.tgz#1ed57a489249b9260bc604325ae333766d4cddc9"
integrity sha512-SDFoU5F4LdosEiUVWUDRPCV/C1zQRNtIakx7rWkigf7R4sxGADlSEeOma4S1f/js7YAzvqLW92ByoiQptg+8oQ==
[email protected].16:
version "6.3.16"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.16.tgz#76d1a705fd1cf864ee5ed85270b572641e0958ef"
integrity sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ==
dependencies:
body-parser "^1.19.0"
braces "^3.0.2"
Expand All @@ -4432,6 +4432,7 @@ [email protected]:
log4js "^6.4.1"
mime "^2.5.2"
minimatch "^3.0.4"
mkdirp "^0.5.5"
qjobs "^1.2.0"
range-parser "^1.2.1"
rimraf "^3.0.2"
Expand Down
2 changes: 1 addition & 1 deletion src/danfojs-browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"ify-loader": "^1.1.0",
"install-peers": "^1.0.3",
"json-loader": "^0.5.7",
"karma": "6.3.14",
"karma": "6.3.16",
"karma-browserify": "7.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
Expand Down
11 changes: 6 additions & 5 deletions src/danfojs-browser/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4314,10 +4314,10 @@ karma-mocha@^2.0.1:
dependencies:
minimist "^1.2.3"

[email protected].14:
version "6.3.14"
resolved "https://registry.npmjs.org/karma/-/karma-6.3.14.tgz"
integrity sha512-SDFoU5F4LdosEiUVWUDRPCV/C1zQRNtIakx7rWkigf7R4sxGADlSEeOma4S1f/js7YAzvqLW92ByoiQptg+8oQ==
[email protected].16:
version "6.3.16"
resolved "https://registry.yarnpkg.com/karma/-/karma-6.3.16.tgz#76d1a705fd1cf864ee5ed85270b572641e0958ef"
integrity sha512-nEU50jLvDe5yvXqkEJRf8IuvddUkOY2x5Xc4WXHz6dxINgGDrgD2uqQWeVrJs4hbfNaotn+HQ1LZJ4yOXrL7xQ==
dependencies:
body-parser "^1.19.0"
braces "^3.0.2"
Expand All @@ -4334,6 +4334,7 @@ [email protected]:
log4js "^6.4.1"
mime "^2.5.2"
minimatch "^3.0.4"
mkdirp "^0.5.5"
qjobs "^1.2.0"
range-parser "^1.2.1"
rimraf "^3.0.2"
Expand Down Expand Up @@ -4679,7 +4680,7 @@ mkdirp-classic@^0.5.2:
resolved "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz"
integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==

mkdirp@^0.5.1:
mkdirp@^0.5.1, mkdirp@^0.5.5:
version "0.5.5"
resolved "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
Expand Down
13 changes: 7 additions & 6 deletions src/danfojs-node/test/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { assert } from "chai";
import { describe, it } from "mocha";
import { ArrayType1D } from "../dist/danfojs-base/shared/types";
import { Utils, __version } from "../dist/danfojs-node/src";
import packagejson from "../package.json";

Expand Down Expand Up @@ -147,27 +148,27 @@ describe("Utils", function () {

describe("replaceUndefinedWithNaN", function () {
it("replace undefined in Series with NaN", function () {
let data = [10.01, 2.2, undefined, 20.505, 20.22, undefined];
let data = [10.01, 2.2, undefined, 20.505, 20.22, undefined] as ArrayType1D;
assert.deepEqual(utils.replaceUndefinedWithNaN(data, true), [10.01, 2.2, NaN, 20.505, 20.22, NaN]);
});

it("replace undefined in DataFrame with NaN", function () {
let data = [[10.01, 2.2, undefined, 20.505, 20.22, undefined],
[10.01, undefined, undefined, 20.505, 20, undefined]];
let data = [[10.01, 2.2, undefined, 20.505, 20.22, undefined] as ArrayType1D,
[10.01, undefined, undefined, 20.505, 20, undefined] as ArrayType1D];

let result = [[10.01, 2.2, NaN, 20.505, 20.22, NaN],
[10.01, NaN, NaN, 20.505, 20, NaN]];
assert.deepEqual(utils.replaceUndefinedWithNaN(data, false), result);
});

it("replace null in Series with NaN", function () {
let data = [10.01, 2.2, null, 20.505, 20.22, null];
let data = [10.01, 2.2, null, 20.505, 20.22, null] as ArrayType1D;
assert.deepEqual(utils.replaceUndefinedWithNaN(data, true), [10.01, 2.2, NaN, 20.505, 20.22, NaN]);
});

it("replace null in DataFrame with NaN", function () {
let data = [[10.01, 2.2, null, 20.505, 20.22, null],
[10.01, null, null, 20.505, 20, null]];
let data = [[10.01, 2.2, null, 20.505, 20.22, null] as ArrayType1D,
[10.01, null, null, 20.505, 20, null] as ArrayType1D];

let result = [[10.01, 2.2, NaN, 20.505, 20.22, NaN],
[10.01, NaN, NaN, 20.505, 20, NaN]];
Expand Down

0 comments on commit 8ebf233

Please sign in to comment.