|
1 | 1 | import { assert } from "chai";
|
2 | 2 | import { describe, it } from "mocha";
|
| 3 | +import { ArrayType1D } from "../dist/danfojs-base/shared/types"; |
3 | 4 | import { Utils, __version } from "../dist/danfojs-node/src";
|
4 | 5 | import packagejson from "../package.json";
|
5 | 6 |
|
@@ -147,27 +148,27 @@ describe("Utils", function () {
|
147 | 148 |
|
148 | 149 | describe("replaceUndefinedWithNaN", function () {
|
149 | 150 | it("replace undefined in Series with NaN", function () {
|
150 |
| - let data = [10.01, 2.2, undefined, 20.505, 20.22, undefined]; |
| 151 | + let data = [10.01, 2.2, undefined, 20.505, 20.22, undefined] as ArrayType1D; |
151 | 152 | assert.deepEqual(utils.replaceUndefinedWithNaN(data, true), [10.01, 2.2, NaN, 20.505, 20.22, NaN]);
|
152 | 153 | });
|
153 | 154 |
|
154 | 155 | it("replace undefined in DataFrame with NaN", function () {
|
155 |
| - let data = [[10.01, 2.2, undefined, 20.505, 20.22, undefined], |
156 |
| - [10.01, undefined, undefined, 20.505, 20, undefined]]; |
| 156 | + let data = [[10.01, 2.2, undefined, 20.505, 20.22, undefined] as ArrayType1D, |
| 157 | + [10.01, undefined, undefined, 20.505, 20, undefined] as ArrayType1D]; |
157 | 158 |
|
158 | 159 | let result = [[10.01, 2.2, NaN, 20.505, 20.22, NaN],
|
159 | 160 | [10.01, NaN, NaN, 20.505, 20, NaN]];
|
160 | 161 | assert.deepEqual(utils.replaceUndefinedWithNaN(data, false), result);
|
161 | 162 | });
|
162 | 163 |
|
163 | 164 | it("replace null in Series with NaN", function () {
|
164 |
| - let data = [10.01, 2.2, null, 20.505, 20.22, null]; |
| 165 | + let data = [10.01, 2.2, null, 20.505, 20.22, null] as ArrayType1D; |
165 | 166 | assert.deepEqual(utils.replaceUndefinedWithNaN(data, true), [10.01, 2.2, NaN, 20.505, 20.22, NaN]);
|
166 | 167 | });
|
167 | 168 |
|
168 | 169 | it("replace null in DataFrame with NaN", function () {
|
169 |
| - let data = [[10.01, 2.2, null, 20.505, 20.22, null], |
170 |
| - [10.01, null, null, 20.505, 20, null]]; |
| 170 | + let data = [[10.01, 2.2, null, 20.505, 20.22, null] as ArrayType1D, |
| 171 | + [10.01, null, null, 20.505, 20, null] as ArrayType1D]; |
171 | 172 |
|
172 | 173 | let result = [[10.01, 2.2, NaN, 20.505, 20.22, NaN],
|
173 | 174 | [10.01, NaN, NaN, 20.505, 20, NaN]];
|
|
0 commit comments