Skip to content

Commit a4aea54

Browse files
authored
Merge pull request #149 from opensource9ja/fix/reader
Prepare new danfo-node version (0.2.4)
2 parents 499f1d7 + 7d521b3 commit a4aea54

5 files changed

Lines changed: 5 additions & 145 deletions

File tree

danfojs-node/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ easy and intuitive. It is heavily inspired by [Pandas](https://pandas.pydata.org
5151
To use Danfo.js via script tags, copy and paste the CDN below to the body of your HTML file
5252

5353
```html
54-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.2.3/lib/bundle.min.js"></script>
54+
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.2.4/lib/bundle.min.js"></script>
5555
```
5656

5757
### Example Usage in the Browser
@@ -66,7 +66,7 @@ To use Danfo.js via script tags, copy and paste the CDN below to the body of you
6666
<meta charset="UTF-8">
6767
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6868
<script src="https://cdn.plot.ly/plotly-1.2.0.min.js"></script>
69-
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.2.3/lib/bundle.min.js"></script>
69+
<script src="https://cdn.jsdelivr.net/npm/danfojs@0.2.4/lib/bundle.min.js"></script>
7070

7171
<title>Document</title>
7272
</head>

danfojs-node/dist/core/utils.js

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -253,146 +253,6 @@ class Utils {
253253
}
254254
}
255255

256-
__get_tt(arr_val) {
257-
if (this.__is_1D_array(arr_val)) {
258-
let dtypes = [];
259-
let int_tracker = [];
260-
let float_tracker = [];
261-
let string_tracker = [];
262-
let bool_tracker = [];
263-
let lim;
264-
265-
if (arr_val.length == 0) {
266-
dtypes.push("string");
267-
}
268-
269-
if (arr_val.length < config.get_dtype_test_lim) {
270-
lim = arr_val.length - 1;
271-
} else {
272-
lim = config.get_dtype_test_lim - 1;
273-
}
274-
275-
arr_val.forEach((ele, indx) => {
276-
let count = indx;
277-
278-
if (typeof ele == "boolean") {
279-
float_tracker.push(false);
280-
int_tracker.push(false);
281-
string_tracker.push(false);
282-
bool_tracker.push(true);
283-
} else if (isNaN(ele) && typeof ele != "string") {
284-
float_tracker.push(true);
285-
int_tracker.push(false);
286-
string_tracker.push(false);
287-
bool_tracker.push(false);
288-
} else if (!isNaN(Number(ele))) {
289-
if (ele.toString().includes(".")) {
290-
float_tracker.push(true);
291-
int_tracker.push(false);
292-
string_tracker.push(false);
293-
bool_tracker.push(false);
294-
} else {
295-
float_tracker.push(false);
296-
int_tracker.push(true);
297-
string_tracker.push(false);
298-
bool_tracker.push(false);
299-
}
300-
} else {
301-
float_tracker.push(false);
302-
int_tracker.push(false);
303-
string_tracker.push(true);
304-
bool_tracker.push(false);
305-
}
306-
307-
if (count == lim) {
308-
const even = element => element == true;
309-
310-
if (string_tracker.some(even)) {
311-
dtypes.push("string");
312-
} else if (float_tracker.some(even)) {
313-
dtypes.push("float32");
314-
} else if (int_tracker.some(even)) {
315-
dtypes.push("int32");
316-
} else if (bool_tracker.some(even)) {
317-
dtypes.push("boolean");
318-
} else {
319-
dtypes.push("undefined");
320-
}
321-
}
322-
});
323-
return dtypes;
324-
} else {
325-
let dtypes = [];
326-
let lim;
327-
arr_val.forEach(arr => {
328-
let int_tracker = [];
329-
let float_tracker = [];
330-
let string_tracker = [];
331-
let bool_tracker = [];
332-
333-
if (arr.length == 0) {
334-
dtypes.push("string");
335-
}
336-
337-
if (arr.length < config.get_dtype_test_lim) {
338-
lim = arr.length - 1;
339-
} else {
340-
lim = config.get_dtype_test_lim - 1;
341-
}
342-
343-
arr.forEach((ele, indx) => {
344-
let count = indx;
345-
346-
if (typeof ele == "boolean") {
347-
float_tracker.push(false);
348-
int_tracker.push(false);
349-
string_tracker.push(false);
350-
bool_tracker.push(true);
351-
} else if (!isNaN(Number(ele))) {
352-
if (ele.toString().includes(".")) {
353-
float_tracker.push(true);
354-
int_tracker.push(false);
355-
string_tracker.push(false);
356-
bool_tracker.push(false);
357-
} else {
358-
float_tracker.push(false);
359-
int_tracker.push(true);
360-
string_tracker.push(false);
361-
bool_tracker.push(false);
362-
}
363-
} else if (isNaN(ele) && typeof ele != "string") {
364-
float_tracker.push(true);
365-
int_tracker.push(false);
366-
string_tracker.push(false);
367-
bool_tracker.push(false);
368-
} else {
369-
float_tracker.push(false);
370-
int_tracker.push(false);
371-
string_tracker.push(true);
372-
bool_tracker.push(false);
373-
}
374-
375-
if (count == lim) {
376-
const even = element => element == true;
377-
378-
if (string_tracker.some(even)) {
379-
dtypes.push("string");
380-
} else if (float_tracker.some(even)) {
381-
dtypes.push("float32");
382-
} else if (int_tracker.some(even)) {
383-
dtypes.push("int32");
384-
} else if (bool_tracker.some(even)) {
385-
dtypes.push("boolean");
386-
} else {
387-
dtypes.push("undefined");
388-
}
389-
}
390-
});
391-
});
392-
return dtypes;
393-
}
394-
}
395-
396256
__unique(data) {
397257
let unique = new Set();
398258
data.map(function (val) {

danfojs-node/dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,5 +154,5 @@ var _utils = require("./core/utils");
154154
var _tf = _interopRequireWildcard(require("@tensorflow/tfjs-node"));
155155

156156
exports.tf = _tf;
157-
const _version = "0.2.3";
157+
const _version = "0.2.4";
158158
exports._version = _version;

danfojs-node/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "danfojs-node",
3-
"version": "0.2.3",
3+
"version": "0.2.4",
44
"description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.",
55
"main": "dist/index.js",
66
"types": "types/index.d.ts",

danfojs-node/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ export { Str } from "./core/strings";
1616
export { Utils } from "./core/utils";
1717
export * as tf from "@tensorflow/tfjs-node";
1818

19-
export const _version = "0.2.3";
19+
export const _version = "0.2.4";

0 commit comments

Comments
 (0)