Skip to content

Commit d9f0ee6

Browse files
committed
Merge branch 'danfo/typescript' of https://github.com/opensource9ja/danfojs into danfo/typescript
2 parents 5a02511 + df89bf9 commit d9f0ee6

64 files changed

Lines changed: 6314 additions & 8347 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/node.js.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ name: Node.js CI
55

66
on:
77
push:
8-
branches: [ master ]
8+
branches: [ master, dev, danfo/typescript ]
99
pull_request:
10-
branches: [ master ]
10+
branches: [ master, dev ]
1111

1212
jobs:
1313
test:
@@ -16,12 +16,12 @@ jobs:
1616

1717
strategy:
1818
matrix:
19-
node-version: [10.x, 12.x, 14.x]
19+
node-version: [12.x, 14.x]
2020

2121
steps:
2222
- uses: actions/checkout@v2
2323
- name: Use Node.js ${{ matrix.node-version }}
2424
uses: actions/setup-node@v1
2525
with:
2626
node-version: ${{ matrix.node-version }}
27-
- run: yarn && yarn test
27+
- run: yarn test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ test/fixtures/titanicO*
44
danfojs-node/test/samples/test*
55
danfojs-node/test/samples/titanicO*
66
danfojs-node/test/samples/sampleO*
7+
src/danfojs-node/test/samples/sampleOut.xlsx
8+
src/danfojs-node/test/samples/test.xlsx
9+
src/danfojs-node/test/samples/testSeries.xlsx

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
"danfojs-browser/**"
77
],
88
"scripts": {
9-
"install": "cd danfojs-node && yarn && cd ../danfojs-browser && yarn",
10-
"build": "cd danfojs-node && yarn build:clean && cd ../danfojs-browser && yarn build:clean",
11-
"test": "cd danfojs-node && yarn && yarn test:clean && cd ../danfojs-browser && yarn && yarn test:clean"
9+
"install": "cd src/danfojs-base && yarn && cd ../danfojs-browser && yarn && cd ../danfojs-node && yarn",
10+
"build": "cd src/danfojs-node && yarn build:clean && cd ../danfojs-browser && yarn build:clean",
11+
"test": "cd src/danfojs-base && yarn && cd ../danfojs-node && yarn && yarn test:clean && cd ../danfojs-browser && yarn && yarn test:clean"
1212
}
1313
}

src/danfojs-base/aggregators/groupby.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import { Console } from "console";
21
import DataFrame from "../core/frame"
32
import { ArrayType1D, ArrayType2D } from "../shared/types"
43
import { variance, std, median, mode, mean } from 'mathjs';
5-
import Utils from "../shared/utils";
64
import concat from "../transformers/concat"
75
import Series from "../core/series";
86

@@ -450,7 +448,7 @@ export default class Groupby {
450448
return this.operations("min")
451449
}
452450

453-
get_group(keys: Array<string | number>): DataFrame {
451+
getGroup(keys: Array<string | number>): DataFrame {
454452
let dictKey = keys.join("-")
455453
let colDict: { [key: string ]: {} } = {}
456454
colDict[dictKey] = {...this.colDict[dictKey]}

src/danfojs-base/core/frame.ts

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import NDframe from "./generic";
2525
import { table } from "table";
2626
import Series from './series';
2727
import Groupby from '../aggregators/groupby'
28-
import { PlotlyLib } from "../plotting";
2928

3029
const utils = new Utils();
3130

@@ -416,7 +415,7 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
416415
if (colLen > maxColToDisplayInConsole) {
417416
//truncate displayed columns to fit in the console
418417
let firstFourcolNames = this.columns.slice(0, 4);
419-
let lastThreecolNames = this.columns.slice(colLen - 4);
418+
let lastThreecolNames = this.columns.slice(colLen - 3);
420419
//join columns with truncate ellipse in the middle
421420
header = ["", ...firstFourcolNames, "...", ...lastThreecolNames];
422421

@@ -433,7 +432,7 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
433432

434433
let dfSubset2 = this.iloc({
435434
rows: [`0:${maxRow}`],
436-
columns: [`${colLen - 4}:`]
435+
columns: [`${colLen - 3}:`]
437436
});
438437

439438
subIdx = this.index.slice(0, maxRow);
@@ -442,7 +441,7 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
442441

443442
} else {
444443
let dfSubset1 = this.iloc({ columns: ["0:4"] });
445-
let dfSubset2 = this.iloc({ columns: [`${colLen - 4}:`] });
444+
let dfSubset2 = this.iloc({ columns: [`${colLen - 3}:`] });
446445

447446
subIdx = this.index.slice(0, maxRow);
448447
firstHalfValues = dfSubset1.values as ArrayType2D
@@ -2447,17 +2446,4 @@ export default class DataFrame extends NDframe implements DataFrameInterface {
24472446
).group()
24482447

24492448
}
2450-
2451-
/**
2452-
* Make plots of Series or DataFrame.
2453-
* Uses the Plotly as backend, so supports Plotly's configuration parameters
2454-
* @param divId Name of the div to show the plot
2455-
* @returns Plotly class that expoese different plot type
2456-
*/
2457-
plot(divId: string) {
2458-
//TODO: Add support for check plot library to use
2459-
// So we can support other plot library like d3, vega, etc
2460-
const plt = new PlotlyLib(this, divId);
2461-
return plt;
2462-
}
24632449
}

src/danfojs-base/core/series.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import Dt from './datetime';
2626
import dummyEncode from "../transformers/encoders/dummy.encoder";
2727
import DataFrame from "./frame";
2828
import tensorflow from '../shared/tensorflowlib'
29-
import { PlotlyLib } from "../plotting";
3029

3130
const utils = new Utils();
3231

@@ -1359,18 +1358,4 @@ export default class Series extends NDframe implements SeriesInterface {
13591358
}): DataFrame {
13601359
return dummyEncode(this, options)
13611360
}
1362-
1363-
1364-
/**
1365-
* Make plots of Series or DataFrame.
1366-
* Uses the PlotlyLib as backend, so supports PlotlyLib's configuration parameters
1367-
* @param divId Name of the div to show the plot
1368-
* @returns PlotlyLib class that expoese different plot type
1369-
*/
1370-
plot(divId: string) {
1371-
//TODO: Add support for check plot library to use
1372-
// So we can support other plot library like d3, vega, etc
1373-
const plt = new PlotlyLib(this, divId);
1374-
return plt;
1375-
}
13761361
}

src/danfojs-base/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import concat from "./transformers/concat"
2828
import merge from "./transformers/merge"
2929
import date_range from "./core/daterange"
3030

31+
const __version = "1.0.0"
32+
3133
export {
3234
NDframe,
3335
Config,
@@ -45,4 +47,5 @@ export {
4547
concat,
4648
merge,
4749
date_range,
50+
__version,
4851
}

src/danfojs-base/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "danfojs-base",
3-
"version": "0.3.3",
3+
"version": "1.0.0",
44
"description": "Base package used in danfojs-node and danfojs-browser",
55
"main": "index.ts",
66
"scripts": {
@@ -9,11 +9,9 @@
99
"author": "",
1010
"license": "ISC",
1111
"devDependencies": {
12-
"@types/plotly.js-dist-min": "^2.3.0",
1312
"dotenv": "^10.0.0"
1413
},
1514
"dependencies": {
16-
"plotly.js-dist-min": "^2.8.0",
1715
"@tensorflow/tfjs": "3.6.0",
1816
"@tensorflow/tfjs-node": "3.6.1",
1917
"mathjs": "^10.0.0",

src/danfojs-base/shared/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default class Configs {
3535
} = {
3636
tableDisplayConfig: {},
3737
tableMaxRow: 10,
38-
tableMaxColInConsole: 21,
38+
tableMaxColInConsole: 10,
3939
dtypeTestLim: 10,
4040
lowMemoryMode: false,
4141
...options
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
2-
// This file is auto-generated by prebuild.js. Do not edit!
3-
const tf = require("@tensorflow/tfjs")
4-
export default tf
5-
1+
const tf = require("@tensorflow/tfjs-node")
2+
export default tf

0 commit comments

Comments
 (0)