From 7d521b32ec78ee1fcdd7837cbb9682be710c52b5 Mon Sep 17 00:00:00 2001 From: Rising Odegua Date: Wed, 10 Mar 2021 10:48:07 +0100 Subject: [PATCH] Prepare new danfo-node version (0.2.4) --- danfojs-node/README.md | 4 +- danfojs-node/dist/core/utils.js | 140 -------------------------------- danfojs-node/dist/index.js | 2 +- danfojs-node/package.json | 2 +- danfojs-node/src/index.js | 2 +- 5 files changed, 5 insertions(+), 145 deletions(-) diff --git a/danfojs-node/README.md b/danfojs-node/README.md index a87f0aa3..863ef659 100644 --- a/danfojs-node/README.md +++ b/danfojs-node/README.md @@ -51,7 +51,7 @@ easy and intuitive. It is heavily inspired by [Pandas](https://pandas.pydata.org To use Danfo.js via script tags, copy and paste the CDN below to the body of your HTML file ```html - + ``` ### 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 - + Document diff --git a/danfojs-node/dist/core/utils.js b/danfojs-node/dist/core/utils.js index f7f0ec6a..5d6b105e 100644 --- a/danfojs-node/dist/core/utils.js +++ b/danfojs-node/dist/core/utils.js @@ -253,146 +253,6 @@ class Utils { } } - __get_tt(arr_val) { - if (this.__is_1D_array(arr_val)) { - let dtypes = []; - let int_tracker = []; - let float_tracker = []; - let string_tracker = []; - let bool_tracker = []; - let lim; - - if (arr_val.length == 0) { - dtypes.push("string"); - } - - if (arr_val.length < config.get_dtype_test_lim) { - lim = arr_val.length - 1; - } else { - lim = config.get_dtype_test_lim - 1; - } - - arr_val.forEach((ele, indx) => { - let count = indx; - - if (typeof ele == "boolean") { - float_tracker.push(false); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(true); - } else if (isNaN(ele) && typeof ele != "string") { - float_tracker.push(true); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(false); - } else if (!isNaN(Number(ele))) { - if (ele.toString().includes(".")) { - float_tracker.push(true); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(false); - } else { - float_tracker.push(false); - int_tracker.push(true); - string_tracker.push(false); - bool_tracker.push(false); - } - } else { - float_tracker.push(false); - int_tracker.push(false); - string_tracker.push(true); - bool_tracker.push(false); - } - - if (count == lim) { - const even = element => element == true; - - if (string_tracker.some(even)) { - dtypes.push("string"); - } else if (float_tracker.some(even)) { - dtypes.push("float32"); - } else if (int_tracker.some(even)) { - dtypes.push("int32"); - } else if (bool_tracker.some(even)) { - dtypes.push("boolean"); - } else { - dtypes.push("undefined"); - } - } - }); - return dtypes; - } else { - let dtypes = []; - let lim; - arr_val.forEach(arr => { - let int_tracker = []; - let float_tracker = []; - let string_tracker = []; - let bool_tracker = []; - - if (arr.length == 0) { - dtypes.push("string"); - } - - if (arr.length < config.get_dtype_test_lim) { - lim = arr.length - 1; - } else { - lim = config.get_dtype_test_lim - 1; - } - - arr.forEach((ele, indx) => { - let count = indx; - - if (typeof ele == "boolean") { - float_tracker.push(false); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(true); - } else if (!isNaN(Number(ele))) { - if (ele.toString().includes(".")) { - float_tracker.push(true); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(false); - } else { - float_tracker.push(false); - int_tracker.push(true); - string_tracker.push(false); - bool_tracker.push(false); - } - } else if (isNaN(ele) && typeof ele != "string") { - float_tracker.push(true); - int_tracker.push(false); - string_tracker.push(false); - bool_tracker.push(false); - } else { - float_tracker.push(false); - int_tracker.push(false); - string_tracker.push(true); - bool_tracker.push(false); - } - - if (count == lim) { - const even = element => element == true; - - if (string_tracker.some(even)) { - dtypes.push("string"); - } else if (float_tracker.some(even)) { - dtypes.push("float32"); - } else if (int_tracker.some(even)) { - dtypes.push("int32"); - } else if (bool_tracker.some(even)) { - dtypes.push("boolean"); - } else { - dtypes.push("undefined"); - } - } - }); - }); - return dtypes; - } - } - __unique(data) { let unique = new Set(); data.map(function (val) { diff --git a/danfojs-node/dist/index.js b/danfojs-node/dist/index.js index a411adee..9151784d 100644 --- a/danfojs-node/dist/index.js +++ b/danfojs-node/dist/index.js @@ -154,5 +154,5 @@ var _utils = require("./core/utils"); var _tf = _interopRequireWildcard(require("@tensorflow/tfjs-node")); exports.tf = _tf; -const _version = "0.2.3"; +const _version = "0.2.4"; exports._version = _version; \ No newline at end of file diff --git a/danfojs-node/package.json b/danfojs-node/package.json index 62cdda93..1d935bbe 100644 --- a/danfojs-node/package.json +++ b/danfojs-node/package.json @@ -1,6 +1,6 @@ { "name": "danfojs-node", - "version": "0.2.3", + "version": "0.2.4", "description": "JavaScript library providing high performance, intuitive, and easy to use data structures for manipulating and processing structured data.", "main": "dist/index.js", "types": "types/index.d.ts", diff --git a/danfojs-node/src/index.js b/danfojs-node/src/index.js index 46737d0e..d02ae08e 100644 --- a/danfojs-node/src/index.js +++ b/danfojs-node/src/index.js @@ -16,4 +16,4 @@ export { Str } from "./core/strings"; export { Utils } from "./core/utils"; export * as tf from "@tensorflow/tfjs-node"; -export const _version = "0.2.3"; +export const _version = "0.2.4";